"use client"; import { ShieldCheck } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useLocale, useTranslations } from "next-intl"; import { LocaleToggle } from "@/components/layout/locale-toggle"; import { SoundToggle } from "@/components/sound-toggle"; import { ThemeToggle } from "@/components/theme-toggle"; import { Dock, DockIcon } from "@/components/ui/dock"; import { buildAdminUrl } from "@/lib/admin-routing"; import { getLocalizedPath, stripLocalePrefix, type AppLocale } from "@/lib/locale"; import { cn } from "@/lib/utils"; type SiteDockProps = { defaultLocale: AppLocale; /** * Server-computed via `isSuperAdmin()` in the parent layout. This client * component only decides whether to *render* the Admin shortcut — it performs * no auth check and grants no access; the real guard lives server-side on * each admin page/action. */ isSuperAdmin?: boolean; }; type NavKey = "home" | "about" | "portfolio" | "products" | "contact"; type NavItem = { key: NavKey; path: string; disabled?: boolean; }; const navItems: NavItem[] = [ { key: "home", path: "" }, { key: "about", path: "/about" }, { key: "portfolio", path: "/portfolio" }, { key: "products", path: "/products", disabled: true }, { key: "contact", path: "/contact" }, ]; // Graphite squircle that matches the SVG page icons, used for the live control // tiles (theme / sound / language / admin) so the whole dock reads as one set. const controlTile = "group relative overflow-visible rounded-[26%] bg-gradient-to-b from-[#3f4551] to-[#191d24] shadow-[0_6px_14px_-6px_rgba(0,0,0,0.5)] ring-1 ring-white/10 transition-shadow duration-200 hover:shadow-[0_10px_22px_-8px_rgba(0,0,0,0.6)]"; const controlButton = "h-full w-full rounded-[inherit] border-0 bg-transparent text-white hover:bg-white/10 hover:text-white"; function isNavItemActive(currentPath: string, itemPath: string) { if (itemPath === "/") { return currentPath === "/"; } return currentPath === itemPath || currentPath.startsWith(`${itemPath}/`); } export function SiteDock({ defaultLocale, isSuperAdmin = false }: SiteDockProps) { const locale = useLocale(); const pathname = usePathname(); const t = useTranslations("navigation"); const currentPath = stripLocalePrefix(pathname); const homeHref = getLocalizedPath(locale, "/", defaultLocale); return (