import { appPath } from "@agent-native/core/client/api-path"; import { DevDatabaseLink } from "@agent-native/core/client/db-admin"; import { LanguagePicker, useT } from "@agent-native/core/client/i18n"; import { openCommandMenu } from "@agent-native/core/client/navigation"; import { OrgSwitcher } from "@agent-native/core/client/org"; import { FeedbackButton } from "@agent-native/core/client/ui"; import { SidebarFooterActions } from "@agent-native/toolkit/app-shell"; import { IconPencil, IconTemplate, IconPalette, IconSettings, IconLayoutSidebarLeftCollapse, IconLayoutSidebarLeftExpand, IconSearch, } from "@tabler/icons-react"; import { useEffect, useState } from "react"; import { Link, useLocation } from "react-router"; import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; const navItems = [ { icon: IconPencil, labelKey: "navigation.designs", href: "/" }, { icon: IconTemplate, labelKey: "navigation.templates", href: "/templates" }, { icon: IconPalette, labelKey: "navigation.designSystems", href: "/design-systems", }, ]; const bottomNavItems = [ { icon: IconSettings, labelKey: "navigation.settings", href: "/settings" }, ]; const COLLAPSE_KEY = "design.sidebar.collapsed"; export function Sidebar() { const location = useLocation(); const t = useT(); const [collapsed, setCollapsed] = useState(() => { if (typeof window === "undefined") return false; try { return window.localStorage.getItem(COLLAPSE_KEY) === "1"; } catch { return false; } }); useEffect(() => { if (typeof window === "undefined") return; try { window.localStorage.setItem(COLLAPSE_KEY, collapsed ? "1" : "0"); } catch { // localStorage unavailable / quota — ignore } }, [collapsed]); const collapseButton = ( {collapsed ? t("navigation.expandSidebar") : t("navigation.collapseSidebar")} ); const searchButton = ( {t("root.commandSearch")} ); const translateButton = ( ); const feedbackButton = ( ); return ( ); }