Spaces:
Build error
Build error
Mehdi commited on
Upload components/Sidebar.jsx with huggingface_hub
Browse files- components/Sidebar.jsx +82 -0
components/Sidebar.jsx
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState } from 'react'
|
| 2 |
+
import { FiFile, FiFolder, FiChevronDown, FiChevronRight, FiPlus, FiSettings, FiSearch, FiGithub, FiTerminal, FiDebug, FiExtensions, FiUser, FiBook } from 'react-icons/fi'
|
| 3 |
+
|
| 4 |
+
export default function Sidebar() {
|
| 5 |
+
const [expanded, setExpanded] = useState({
|
| 6 |
+
explorer: true,
|
| 7 |
+
search: false,
|
| 8 |
+
sourceControl: false,
|
| 9 |
+
run: false,
|
| 10 |
+
extensions: false
|
| 11 |
+
})
|
| 12 |
+
|
| 13 |
+
const toggleSection = (section) => {
|
| 14 |
+
setExpanded(prev => ({ ...prev, [section]: !prev[section] }))
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
return (
|
| 18 |
+
<div className="w-64 bg-sidebar text-gray-300 h-full flex flex-col">
|
| 19 |
+
<div className="p-3 border-b border-border">
|
| 20 |
+
<div className="flex items-center space-x-2 mb-4">
|
| 21 |
+
<FiFile className="text-blue-400" />
|
| 22 |
+
<span className="text-sm">Explorer</span>
|
| 23 |
+
</div>
|
| 24 |
+
<div className="space-y-1">
|
| 25 |
+
<button className="w-full text-left p-2 rounded hover:bg-panel transition-colors flex items-center space-x-2">
|
| 26 |
+
<FiFolder className="text-blue-400" />
|
| 27 |
+
<span className="text-sm">Open Folder</span>
|
| 28 |
+
</button>
|
| 29 |
+
<button className="w-full text-left p-2 rounded hover:bg-panel transition-colors flex items-center space-x-2">
|
| 30 |
+
<FiFile className="text-gray-400" />
|
| 31 |
+
<span className="text-sm">New File</span>
|
| 32 |
+
</button>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<div className="flex-1 overflow-y-auto">
|
| 37 |
+
<div className="p-2">
|
| 38 |
+
<div className="flex items-center justify-between p-1 hover:bg-panel rounded cursor-pointer" onClick={() => toggleSection('explorer')}>
|
| 39 |
+
<div className="flex items-center space-x-2">
|
| 40 |
+
<FiFolder className="text-blue-400" />
|
| 41 |
+
<span className="text-sm">PROJECTS</span>
|
| 42 |
+
</div>
|
| 43 |
+
{expanded.explorer ? <FiChevronDown /> : <FiChevronRight />}
|
| 44 |
+
</div>
|
| 45 |
+
{expanded.explorer && (
|
| 46 |
+
<div className="ml-4 mt-1 space-y-1">
|
| 47 |
+
<div className="flex items-center space-x-2 p-1 hover:bg-panel rounded">
|
| 48 |
+
<FiFolder className="text-yellow-400" />
|
| 49 |
+
<span className="text-sm">src</span>
|
| 50 |
+
</div>
|
| 51 |
+
<div className="flex items-center space-x-2 p-1 hover:bg-panel rounded">
|
| 52 |
+
<FiFile className="text-gray-400" />
|
| 53 |
+
<span className="text-sm">package.json</span>
|
| 54 |
+
</div>
|
| 55 |
+
<div className="flex items-center space-x-2 p-1 hover:bg-panel rounded">
|
| 56 |
+
<FiFile className="text-gray-400" />
|
| 57 |
+
<span className="text-sm">README.md</span>
|
| 58 |
+
</div>
|
| 59 |
+
</div>
|
| 60 |
+
)}
|
| 61 |
+
</div>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<div className="p-2 border-t border-border">
|
| 65 |
+
<div className="space-y-2">
|
| 66 |
+
<button className="w-full text-left p-2 rounded hover:bg-panel transition-colors flex items-center space-x-2">
|
| 67 |
+
<FiSettings className="text-gray-400" />
|
| 68 |
+
<span className="text-sm">Settings</span>
|
| 69 |
+
</button>
|
| 70 |
+
<button className="w-full text-left p-2 rounded hover:bg-panel transition-colors flex items-center space-x-2">
|
| 71 |
+
<FiExtensions className="text-gray-400" />
|
| 72 |
+
<span className="text-sm">Extensions</span>
|
| 73 |
+
</button>
|
| 74 |
+
<button className="w-full text-left p-2 rounded hover:bg-panel transition-colors flex items-center space-x-2">
|
| 75 |
+
<FiBook className="text-gray-400" />
|
| 76 |
+
<span className="text-sm">Documentation</span>
|
| 77 |
+
</button>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
</div>
|
| 81 |
+
)
|
| 82 |
+
}
|