-
Notifications
You must be signed in to change notification settings - Fork 226
feat(ui): add file explorer toolbar and file search modal #1408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||||||||||||||
| import { ChevronDown, CopyMinus, FilePlus, FolderPlus, Search } from 'lucide-react'; | ||||||||||||||||||
| import { Button } from '../ui/button'; | ||||||||||||||||||
|
|
||||||||||||||||||
| interface FileExplorerToolbarProps { | ||||||||||||||||||
| projectName: string; | ||||||||||||||||||
| onSearch: () => void; | ||||||||||||||||||
| onNewFile: () => void; | ||||||||||||||||||
| onNewFolder: () => void; | ||||||||||||||||||
| onCollapse: () => void; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export const FileExplorerToolbar: React.FC<FileExplorerToolbarProps> = ({ | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing
Suggested change
Or add the import at the top of the file alongside the existing imports:
Suggested change
|
||||||||||||||||||
| projectName, | ||||||||||||||||||
| onSearch, | ||||||||||||||||||
| onNewFile, | ||||||||||||||||||
| onNewFolder, | ||||||||||||||||||
| onCollapse, | ||||||||||||||||||
| }) => { | ||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className="flex h-8 items-center justify-between border-b border-border bg-muted/10 px-2"> | ||||||||||||||||||
| <div className="flex items-center gap-1"> | ||||||||||||||||||
| {/* search button */} | ||||||||||||||||||
|
|
||||||||||||||||||
| <Button variant="ghost" size="sm" onClick={onSearch} className="gap-1 text-xs"> | ||||||||||||||||||
| <Search className="h-3.5 w-3.5" /> | ||||||||||||||||||
| <span>Search</span> | ||||||||||||||||||
| </Button> | ||||||||||||||||||
|
|
||||||||||||||||||
| {/* file actions */} | ||||||||||||||||||
|
|
||||||||||||||||||
| <div className="flex items-center gap-1"> | ||||||||||||||||||
| {/* new file */} | ||||||||||||||||||
| <Button variant="ghost" size="sm" onClick={onNewFile} className="gap-1 text-xs"> | ||||||||||||||||||
| <FilePlus className="h-3.5 w-3.5" /> | ||||||||||||||||||
| </Button> | ||||||||||||||||||
|
|
||||||||||||||||||
| {/* new folder */} | ||||||||||||||||||
|
|
||||||||||||||||||
| <Button variant="ghost" size="sm" onClick={onNewFolder} className="gap-1 text-xs"> | ||||||||||||||||||
| <FolderPlus className="h-3.5 w-3.5" /> | ||||||||||||||||||
| </Button> | ||||||||||||||||||
|
|
||||||||||||||||||
| {/* collapsable */} | ||||||||||||||||||
|
|
||||||||||||||||||
| <Button variant="ghost" size="sm" onClick={onCollapse} className="gap-1 text-xs"> | ||||||||||||||||||
| <CopyMinus className="h-3.5 w-3.5" /> | ||||||||||||||||||
| </Button> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| </div> | ||||||||||||||||||
| ); | ||||||||||||||||||
| }; | ||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.