| 34 | ]; |
| 35 | |
| 36 | export function Sidebar({ collapsed, onToggle }: SidebarProps) { |
| 37 | return ( |
| 38 | <aside |
| 39 | className={cn( |
| 40 | 'flex flex-col h-full bg-[var(--color-surface)] border-r border-[var(--color-border)] transition-all duration-300', |
| 41 | collapsed ? 'w-16' : 'w-56' |
| 42 | )} |
| 43 | > |
| 44 | {/* Logo */} |
| 45 | <div className="flex items-center h-14 px-4 border-b border-[var(--color-border)]"> |
| 46 | <div className="flex items-center gap-2"> |
| 47 | <div className="w-8 h-8 rounded-lg bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-secondary)] flex items-center justify-center"> |
| 48 | <span className="text-white font-bold text-sm">A</span> |
| 49 | </div> |
| 50 | {!collapsed && ( |
| 51 | <span className="font-semibold text-[var(--color-text-primary)]"> |
| 52 | Aster Studio |
| 53 | </span> |
| 54 | )} |
| 55 | </div> |
| 56 | </div> |
| 57 | |
| 58 | {/* Navigation */} |
| 59 | <nav className="flex-1 py-4"> |
| 60 | <ul className="space-y-1 px-2"> |
| 61 | {navItems.map((item) => ( |
| 62 | <li key={item.to}> |
| 63 | <NavLink |
| 64 | to={item.to} |
| 65 | className={({ isActive }) => |
| 66 | cn( |
| 67 | 'flex items-center gap-3 px-3 py-2 rounded-lg transition-colors', |
| 68 | 'hover:bg-[var(--color-surface-elevated)]', |
| 69 | isActive |
| 70 | ? 'bg-[var(--color-primary)]/10 text-[var(--color-primary)]' |
| 71 | : 'text-[var(--color-text-secondary)]' |
| 72 | ) |
| 73 | } |
| 74 | > |
| 75 | <item.icon className="w-5 h-5 flex-shrink-0" /> |
| 76 | {!collapsed && ( |
| 77 | <div className="flex flex-col"> |
| 78 | <span className="text-sm font-medium">{item.label}</span> |
| 79 | <span className="text-xs text-[var(--color-text-muted)]">{item.sublabel}</span> |
| 80 | </div> |
| 81 | )} |
| 82 | </NavLink> |
| 83 | </li> |
| 84 | ))} |
| 85 | </ul> |
| 86 | </nav> |
| 87 | |
| 88 | {/* Collapse Toggle */} |
| 89 | <div className="p-2 border-t border-[var(--color-border)]"> |
| 90 | <button |
| 91 | onClick={onToggle} |
| 92 | className="w-full flex items-center justify-center p-2 rounded-lg hover:bg-[var(--color-surface-elevated)] text-[var(--color-text-muted)] transition-colors" |
| 93 | title={collapsed ? 'Expand sidebar' : 'Collapse sidebar'} |