forked from stackblitz-labs/bolt.diy
-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
7 changed files
with
223 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState, type PropsWithChildren } from 'react'; | ||
|
||
const ThoughtBox = ({ title, children }: PropsWithChildren<{ title: string }>) => { | ||
const [isExpanded, setIsExpanded] = useState(false); | ||
|
||
return ( | ||
<div | ||
onClick={() => setIsExpanded(!isExpanded)} | ||
className={` | ||
bg-bolt-elements-background-depth-2 | ||
shadow-md | ||
rounded-lg | ||
cursor-pointer | ||
transition-all | ||
duration-300 | ||
${isExpanded ? 'max-h-96' : 'max-h-13'} | ||
overflow-auto | ||
border border-bolt-elements-borderColor | ||
`} | ||
> | ||
<div className="p-4 flex items-center gap-4 rounded-lg text-bolt-elements-textSecondary font-medium leading-5 text-sm border border-bolt-elements-borderColor"> | ||
<div className="i-ph:brain-thin text-2xl" /> | ||
<div className="div"> | ||
<span> {title}</span>{' '} | ||
{!isExpanded && <span className="text-bolt-elements-textTertiary"> - Click to expand</span>} | ||
</div> | ||
</div> | ||
<div | ||
className={` | ||
transition-opacity | ||
duration-300 | ||
p-4 | ||
rounded-lg | ||
${isExpanded ? 'opacity-100' : 'opacity-0'} | ||
`} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ThoughtBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.