11"use client" ;
22
33import Button from "./shared/Button" ;
4- import { XMarkIcon , FolderIcon } from "@heroicons/react/24/outline" ;
5-
6- interface Drive {
7- id : string ;
8- name : string ;
9- url : string ;
10- }
4+ import { XMarkIcon } from "@heroicons/react/24/outline" ;
115
126interface SidebarProps {
13- drives : Drive [ ] ;
14- selectedDriveId ?: string ;
15- onDriveSelect : ( driveId : string ) => void ;
167 isOpen ?: boolean ;
178 onClose ?: ( ) => void ;
9+ activeTab ?: string ;
1810}
1911
2012export default function Sidebar ( {
21- drives,
22- selectedDriveId,
23- onDriveSelect,
2413 isOpen = true ,
2514 onClose,
15+ activeTab = "my-storages" ,
2616} : SidebarProps ) {
2717 // On desktop (lg+), sidebar is always visible, so isOpen doesn't matter
2818 // On mobile, use isOpen state
2919 const isMobileOpen = isOpen ;
3020
21+ const navigationTabs = [
22+ { id : "my-storages" , label : "My Storages" } ,
23+ ] ;
24+
3125 return (
3226 < >
3327 { /* Sidebar */ }
@@ -36,11 +30,9 @@ export default function Sidebar({
3630 isMobileOpen ? "translate-x-0" : "-translate-x-full lg:translate-x-0"
3731 } `}
3832 >
39- < nav className = "p-2" aria-label = "Drives navigation " >
33+ < nav className = "p-2" aria-label = "Navigation " >
4034 < div className = "mb-2 flex items-center justify-between px-3 py-2 lg:block" >
41- < h2 className = "text-xs font-medium uppercase tracking-wider text-gray-500" >
42- Drives
43- </ h2 >
35+
4436 { onClose && (
4537 < Button
4638 variant = "icon"
@@ -52,31 +44,27 @@ export default function Sidebar({
5244 </ Button >
5345 ) }
5446 </ div >
47+
48+ { /* Navigation Tabs */ }
5549 < ul className = "space-y-1" role = "list" >
56- { drives . map ( ( drive ) => (
57- < li key = { drive . id } >
58- < button
59- type = "button"
60- onClick = { ( ) => {
61- onDriveSelect ( drive . id ) ;
62- if ( onClose ) {
63- onClose ( ) ;
64- }
65- } }
66- className = { `cursor-pointer w-full rounded-md px-3 py-2 text-left text-sm font-medium transition-colors ${
67- selectedDriveId === drive . id
68- ? "bg-[#F3EDFF] text-black"
69- : "text-gray-700 hover:bg-gray-100"
70- } `}
71- aria-current = { selectedDriveId === drive . id ? "page" : undefined }
72- >
73- < div className = "flex items-center gap-3" >
74- < FolderIcon className = "h-5 w-5 flex-shrink-0 text-gray-600" />
75- < span className = "truncate" > { drive . name } </ span >
76- </ div >
77- </ button >
78- </ li >
79- ) ) }
50+ { navigationTabs . map ( ( tab ) => {
51+ const isActive = activeTab === tab . id ;
52+ return (
53+ < li key = { tab . id } >
54+ < button
55+ type = "button"
56+ className = { `cursor-pointer w-full rounded-md px-3 py-2 text-left text-sm font-medium transition-colors ${
57+ isActive
58+ ? "bg-[#F3EDFF] text-black"
59+ : "text-gray-700 hover:bg-gray-100"
60+ } `}
61+ aria-current = { isActive ? "page" : undefined }
62+ >
63+ { tab . label }
64+ </ button >
65+ </ li >
66+ ) ;
67+ } ) }
8068 </ ul >
8169 </ nav >
8270 </ aside >
0 commit comments