import { appPath } from "@agent-native/core/client/api-path"; import { useT } from "@agent-native/core/client/i18n"; import { OrgSwitcher } from "@agent-native/core/client/org"; import { FeedbackButton } from "@agent-native/core/client/ui"; import { IconCheckbox, IconForms, IconInbox, IconLayoutSidebarLeftCollapse, IconLayoutSidebarLeftExpand, IconSettings, } from "@tabler/icons-react"; import { Link, useLocation } from "react-router"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { APP_TITLE } from "@/lib/app-config"; import { cn } from "@/lib/utils"; const NAV_ITEMS = [ { icon: IconInbox, labelKey: "sidebar.navInbox", href: "/inbox" }, { icon: IconCheckbox, labelKey: "sidebar.navTasks", href: "/tasks" }, { icon: IconForms, labelKey: "sidebar.navFields", href: "/fields" }, ]; const BOTTOM_NAV_ITEMS = [ { icon: IconSettings, labelKey: "header.pageSettings", href: "/settings" }, ]; interface SidebarProps { collapsed?: boolean; collapsible?: boolean; onCollapsedChange?: (collapsed: boolean) => void; } export function Sidebar({ collapsed = false, collapsible = true, onCollapsedChange, }: SidebarProps) { const t = useT(); const location = useLocation(); const ToggleIcon = collapsed ? IconLayoutSidebarLeftExpand : IconLayoutSidebarLeftCollapse; const navClass = ({ isActive }: { isActive: boolean }) => cn( "flex items-center text-sm transition-colors", collapsed ? "relative h-10 w-full justify-center rounded-none border-l-2 px-0" : "h-9 rounded-md gap-3 px-3", isActive ? collapsed ? "border-l-sidebar-accent-foreground/80 bg-sidebar-accent text-sidebar-accent-foreground" : "bg-sidebar-accent text-sidebar-accent-foreground" : collapsed ? "border-l-transparent text-sidebar-foreground/70 hover:bg-sidebar-accent/55 hover:text-sidebar-accent-foreground" : "text-sidebar-foreground hover:bg-sidebar-accent/65 hover:text-sidebar-accent-foreground", ); const collapseButton = collapsible ? ( {collapsed ? t("sidebar.expandSidebar") : t("sidebar.collapseSidebar")} ) : null; return ( ); }