"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { BookOpen, Calendar, Package, ChefHat, User, Rss, FolderOpen, ShoppingCart, Shield, Languages, Search, Compass } from "lucide-react"; import { cn } from "@/lib/utils"; import { buttonVariants } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { authClient } from "@/lib/auth/client"; import { useLocale, SUPPORTED_LOCALES, type Locale } from "@/lib/i18n/provider"; import { useTranslations } from "next-intl"; const NAV_ITEMS = [ { href: "/recipes", key: "recipes", icon: BookOpen }, { href: "/explore", key: "explore", icon: Compass }, { href: "/search", key: "search", icon: Search }, { href: "/feed", key: "feed", icon: Rss }, { href: "/collections", key: "collections", icon: FolderOpen }, { href: "/meal-plan", key: "mealPlan", icon: Calendar }, { href: "/pantry", key: "pantry", icon: Package }, { href: "/shopping-lists", key: "shopping", icon: ShoppingCart }, ] as const; export function Nav() { const pathname = usePathname(); const { data: session } = authClient.useSession(); const isAdmin = (session?.user as { role?: string } | undefined)?.role === "admin"; const { locale, setLocale } = useLocale(); const t = useTranslations("nav"); return (
Epicure
{t("settings")} {t("apiKeys")} {t("webhooks")}

{t("language")}

{SUPPORTED_LOCALES.map((l) => ( ))}
{isAdmin && ( <> {t("admin")} )} authClient.signOut()}> {t("signOut")}
); }