"use client"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { Bell, Boxes, ChartNoAxesCombined, ChevronDown, CircleDollarSign, LayoutDashboard, Leaf, Search, Settings, Store, Users, } from "lucide-react"; import { useState, type ReactNode } from "react"; import { cn } from "@/lib/utils"; const navigation = [ { href: "/", label: "Overview", icon: LayoutDashboard }, { href: "/inventory", label: "Inventory", icon: Boxes }, { href: "/branches", label: "Branches", icon: Store }, { href: "/sales-team", label: "Sales team", icon: Users }, { href: "/recommendations", label: "Recommendations", icon: CircleDollarSign }, { href: "/alerts", label: "Alerts", icon: Bell }, ]; interface SearchItem { id: string; label: string; detail: string; href: string; keywords: string; type: string; } export function DashboardShell({ children, searchItems, }: { children: ReactNode; searchItems: SearchItem[]; }) { const pathname = usePathname(); const router = useRouter(); const [query, setQuery] = useState(""); const [profileOpen, setProfileOpen] = useState(false); const matches = query.trim().length ? searchItems .filter((item) => item.keywords.toLowerCase().includes(query.trim().toLowerCase())) .slice(0, 7) : []; if (pathname === "/login") { return <>{children}>; } return (
No products, branches, or people match “{query}”.
)}Demo account
setProfileOpen(false)} className="block rounded-lg px-3 py-2 text-xs font-semibold hover:bg-slate-50"> Workspace settings