From 19c4661b6ecd52c981e4e497e363f13f32748f63 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:10:58 +0330 Subject: [PATCH] Import source: src/components/shell/header Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- src/components/shell/header.tsx | 215 ++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 src/components/shell/header.tsx diff --git a/src/components/shell/header.tsx b/src/components/shell/header.tsx new file mode 100644 index 0000000..54d1f0e --- /dev/null +++ b/src/components/shell/header.tsx @@ -0,0 +1,215 @@ +"use client"; + +import Link from "next/link"; +import { useQuery } from "@tanstack/react-query"; +import { + Bell, + CircleHelp, + Command, + LogOut, + Menu, + MonitorCog, + Moon, + Search, + Sun, + UserCircle, +} from "lucide-react"; +import * as DropdownMenu from "@radix-ui/react-dropdown-menu"; +import { panelService } from "@/api/services/panel-service"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Logo } from "@/components/common/logo"; +import { cn } from "@/lib/utils"; +import { useUiStore } from "@/stores/ui-store"; + +export function Header() { + const { data } = useQuery({ + queryKey: ["dashboard-summary"], + queryFn: () => panelService.dashboard.summary(), + }); + const setCommandOpen = useUiStore((state) => state.setCommandOpen); + const setTheme = useUiStore((state) => state.setTheme); + const setDensity = useUiStore((state) => state.setDensity); + const setMobileSidebarOpen = useUiStore((state) => state.setMobileSidebarOpen); + const collapsed = useUiStore((state) => state.sidebarCollapsed); + const summary = data?.data; + + return ( +
+ + + + +
+ + setCommandOpen(true)} + /> +
+ + + + } + label="Notifications" + items={[ + "Email queue has deferred messages", + "Backup verified", + "Certificate renewal queued", + ]} + /> + } + label="Help" + items={["Documentation", "Keyboard shortcuts", "Support tickets"]} + /> + + + + + + {(["light", "dark", "system"] as const).map((theme) => ( + setTheme(theme)} + > + {theme} + + ))} + + setDensity("compact")} + > + Compact density + + setDensity("comfortable")} + > + Comfortable density + + + + + + + + + + {summary?.user.email} + + + + Profile settings + + + + Logout + + + +
+ ); +} + +function HeaderMenu({ + icon, + label, + items, +}: { + icon: React.ReactNode; + label: string; + items: string[]; +}) { + return ( + + + + + + + {label} + + {items.map((item) => ( + + {item} + + ))} + + + ); +}