import { Menu as MenuIcon, ShoppingBag, Search } from "lucide-react"; import { useState } from "react"; import { Link } from "react-router"; import { useShopifyCart } from "@/hooks/use-shopify-cart"; import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet"; import { cn } from "@/lib/utils"; export type NavigationProps = { brand: string; logo?: string; links: Array<{ label: string; href: string }>; showSearch: "yes" | "no"; showCart: "yes" | "no"; sticky: "yes" | "no"; tone: "default" | "muted" | "inverse"; bannerText: string; bannerTone: "default" | "accent" | "inverse"; }; export function Navigation({ brand, logo, links, showSearch, showCart, sticky, tone, bannerText, bannerTone, }: NavigationProps) { const [mobileOpen, setMobileOpen] = useState(false); const cart = useShopifyCart(); const itemCount = cart?.itemCount ?? 0; const toneClass: Record = { default: "bg-background text-foreground border-b border-border", muted: "bg-muted/40 text-foreground border-b border-border", inverse: "bg-foreground text-background", }; const bannerToneClass: Record = { default: "bg-muted text-foreground", accent: "bg-primary text-primary-foreground", inverse: "bg-foreground text-background", }; const hasBanner = typeof bannerText === "string" && bannerText.trim().length > 0; return ( <>
{hasBanner && (
{bannerText}
)}
{logo ? ( {brand ) : ( brand || "Brand Logo" )}
{showSearch === "yes" && ( )} {showCart === "yes" && ( )}
{/* Mobile menu */} {brand} ); }