import type { ReactNode } from "react"; import Link from "next/link"; import { ChevronDown, ChevronRight, type LucideIcon } from "lucide-react"; import { Separator } from "@/components/ui/separator"; import { cn } from "@/lib/utils"; type DashboardSidebarItem = { label: string; href: string; icon: LucideIcon; active?: boolean; expanded?: boolean; children?: DashboardSidebarItem[]; }; type DashboardSidebarProps = { items: DashboardSidebarItem[]; iconSrc?: string; brandHref?: string; brandHoverLabel?: string; top?: ReactNode; footerItems?: DashboardSidebarItem[]; footer?: ReactNode; }; export function DashboardSidebar({ items, iconSrc, brandHref = "/", brandHoverLabel, top, footerItems = [], footer, }: DashboardSidebarProps) { function renderItem(item: DashboardSidebarItem, nested = false) { const Icon = item.icon; const hasChildren = Boolean(item.children?.length); const ChevronIcon = item.expanded ? ChevronDown : ChevronRight; return (
Mohs Admin
Website owner workspace
{brandHoverLabel ?? "Back to Home"}