"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 (
Solaire
setQuery(event.target.value)} onKeyDown={(event) => { if (event.key === "Escape") setQuery(""); }} className="h-10 w-full rounded-xl border border-slate-200 bg-slate-50/80 pl-10 pr-3 text-sm outline-none transition focus:border-emerald-400 focus:bg-white focus:ring-4 focus:ring-emerald-50" /> {query.trim() && (
{matches.length ? (
{matches.map((item) => ( ))}
) : (

No products, branches, or people match “{query}”.

)}
)}
{profileOpen && (

Demo account

setProfileOpen(false)} className="block rounded-lg px-3 py-2 text-xs font-semibold hover:bg-slate-50"> Workspace settings
)}
{children}
); }