import { AtSign, FireExtinguisher, Gauge, Home } from "lucide-react"; import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, } from "@/components/ui/sidebar"; import { SmartSearchBar } from "./smartSearchBar"; import { ColorToggle } from "./themeSwitcher"; import { Link } from "@tanstack/react-router"; import { ForwardRefExoticComponent, ReactNode } from "preact/compat"; import { FontPicker } from "./fontPicker"; import { NavUser } from "./auth/navUser"; import { ExternalLinksRow } from "./sidebarLinks"; type BaseMenuItem = { url: string; }; type IconMenuItem = BaseMenuItem & { type: "icon"; title: string; icon: ForwardRefExoticComponent; className?: string; }; type ComponentMenuItem = BaseMenuItem & { type: "component"; component: ReactNode; }; type MenuItem = IconMenuItem | ComponentMenuItem; // Menu items. const items: MenuItem[] = [ { type: "icon", title: "Home", url: "/", icon: Home, }, { type: "icon", title: "Jetstream", url: "/jetstream", icon: FireExtinguisher, }, { type: "icon", title: "Counter", url: "/counter", icon: Gauge, }, ]; export function AppSidebar() { return (
tools
Search{" "}
?
Application {items.map((item) => item.type === "component" ? ( {item.component} ) : ( {item.title} ), )}
); }