import { Compass, Folder, Heart, Home, Settings, User, Github } from "lucide-react"; import { LanguageSettings } from "./LanguageSettings"; import { MobileMenu } from "./MobileMenu"; import { auth } from "@/auth"; import { headers } from "next/headers"; import { getTranslations } from "next-intl/server"; import { GhostLightButton } from "@/design-system/base/button"; import type { ReactNode } from "react"; export interface NavigationItem { label: string; href: string; icon?: ReactNode; external?: boolean; } export async function Navbar() { const t = await getTranslations("navbar"); const session = await auth.api.getSession({ headers: await headers() }); const mobileMenuItems: NavigationItem[] = [ { label: t("folders"), href: "/decks", icon: }, { label: t("explore"), href: "/explore", icon: }, ...(session ? [{ label: t("favorites"), href: "/favorites", icon: }] : []), { label: t("sourceCode"), href: "https://github.com/GoddoNebianU/learn-languages", icon: , external: true }, { label: t("settings"), href: "/settings", icon: }, ...(session ? [{ label: t("profile"), href: "/profile", icon: }] : [{ label: t("sign_in"), href: "/login", icon: }] ), ]; return (
{t("title")}
{t("folders")} {t("explore")} {session && ( {t("favorites")} )} {t("sourceCode")} {t("settings")} {session ? ( {t("profile")} ) : ( {t("sign_in")} )}
); }