import type { LucideIcon } from "lucide-react"; import { FolderOpen, Grid3x3, HelpCircle, LayoutGrid, PenTool, Settings, Workflow, } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; import { cn } from "@/lib/utils"; import { OtterLogo } from "../common/otter-logo"; interface SidebarItem { icon: LucideIcon; label: string; href?: string; } const topItems: SidebarItem[] = [ { icon: LayoutGrid, label: "Tools", href: "/" }, { icon: Grid3x3, label: "Grid", href: "/fullscreen" }, { icon: Workflow, label: "Automate", href: "/automate" }, { icon: PenTool, label: "Editor", href: "/editor" }, { icon: FolderOpen, label: "Files", href: "/files" }, ]; const bottomItems: SidebarItem[] = [ { icon: HelpCircle, label: "Help" }, { icon: Settings, label: "Settings" }, ]; interface SidebarProps { onSettingsClick: () => void; onHelpClick: () => void; /** Called when a nav link is clicked (e.g., to close mobile sidebar). */ onNavClick?: () => void; /** When true, renders in expanded mode (for mobile overlay). */ expanded?: boolean; } export function Sidebar({ onSettingsClick, onHelpClick, onNavClick, expanded = false, }: SidebarProps) { const location = useLocation(); const renderItem = (item: SidebarItem, isActive: boolean) => { const content = expanded ? (