import Image from "next/image"; import Link from "next/link"; import type { ReactNode } from "react"; import { ThemeToggle } from "@/app/theme-toggle"; import { JobsIndicator } from "@/app/components/JobsIndicator"; import { NavIcon, Icon } from "@/app/components/ui"; import { LogoutButton } from "@/app/components/LogoutButton"; import { MobileNav } from "@/app/components/MobileNav"; import { getServerTranslations } from "@/lib/i18n/server"; import type { TranslationKey } from "@/lib/i18n/fr"; type NavItem = { href: "/" | "/books" | "/series" | "/authors" | "/libraries" | "/jobs" | "/tokens" | "/settings"; labelKey: TranslationKey; icon: "dashboard" | "books" | "series" | "authors" | "libraries" | "jobs" | "tokens" | "settings"; }; const navItems: NavItem[] = [ { href: "/", labelKey: "nav.dashboard", icon: "dashboard" }, { href: "/books", labelKey: "nav.books", icon: "books" }, { href: "/series", labelKey: "nav.series", icon: "series" }, { href: "/authors", labelKey: "nav.authors", icon: "authors" }, { href: "/libraries", labelKey: "nav.libraries", icon: "libraries" }, { href: "/jobs", labelKey: "nav.jobs", icon: "jobs" }, { href: "/tokens", labelKey: "nav.tokens", icon: "tokens" }, ]; export default async function AppLayout({ children }: { children: ReactNode }) { const { t } = await getServerTranslations(); return ( <> StripStream {t("common.backoffice")} {navItems.map((item) => ( {t(item.labelKey)} ))} ({ ...item, label: t(item.labelKey) }))} /> {children} > ); } function NavLink({ href, title, children }: { href: NavItem["href"]; title?: string; children: React.ReactNode }) { return ( {children} ); }