|
1 | 1 | import React from "react"; |
| 2 | +import { Folder, FolderUp } from "lucide-react"; |
2 | 3 |
|
3 | 4 | interface DirectoryTreeEntry { |
4 | 5 | name: string; |
@@ -26,36 +27,38 @@ export const DirectoryTree: React.FC<DirectoryTreeProps> = (props) => { |
26 | 27 | }, [currentPath]); |
27 | 28 |
|
28 | 29 | return ( |
29 | | - <div ref={containerRef} className="h-full overflow-y-auto p-2 font-mono text-xs"> |
| 30 | + <div ref={containerRef} className="h-full overflow-y-auto p-2 text-sm"> |
30 | 31 | {isLoading && !currentPath ? ( |
31 | 32 | <div className="text-muted py-4 text-center">Loading directories...</div> |
32 | 33 | ) : ( |
33 | 34 | <ul className="m-0 list-none p-0"> |
34 | 35 | {currentPath && ( |
35 | 36 | <li |
36 | | - className="text-muted cursor-pointer rounded px-2 py-1 text-xs hover:bg-white/5" |
| 37 | + className="text-muted flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 hover:bg-white/5" |
37 | 38 | onClick={onNavigateParent} |
38 | 39 | > |
39 | | - ... |
| 40 | + <FolderUp size={16} className="text-muted shrink-0" /> |
| 41 | + <span>..</span> |
40 | 42 | </li> |
41 | 43 | )} |
42 | 44 |
|
43 | 45 | {!isLoading && !hasEntries ? ( |
44 | | - <li className="text-muted px-2 py-1 text-xs">No subdirectories found</li> |
| 46 | + <li className="text-muted px-2 py-1.5">No subdirectories found</li> |
45 | 47 | ) : null} |
46 | 48 |
|
47 | 49 | {entries.map((entry) => ( |
48 | 50 | <li |
49 | 51 | key={entry.path} |
50 | | - className="text-muted cursor-pointer rounded px-2 py-1 text-xs hover:bg-white/5" |
| 52 | + className="flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 hover:bg-white/5" |
51 | 53 | onClick={() => onNavigateTo(entry.path)} |
52 | 54 | > |
53 | | - {entry.name} |
| 55 | + <Folder size={16} className="shrink-0 text-yellow-500/80" /> |
| 56 | + <span className="truncate">{entry.name}</span> |
54 | 57 | </li> |
55 | 58 | ))} |
56 | 59 |
|
57 | 60 | {isLoading && currentPath && !hasEntries ? ( |
58 | | - <li className="text-muted px-2 py-1 text-xs">Loading directories...</li> |
| 61 | + <li className="text-muted px-2 py-1.5">Loading directories...</li> |
59 | 62 | ) : null} |
60 | 63 | </ul> |
61 | 64 | )} |
|
0 commit comments