import Link from "next/link"; function initialsOf(name: string) { return name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase(); } const TABS = [ { key: "profil", href: "/backend/espace", label: "Mon profil" }, { key: "promotions", href: "/backend/espace/promotions", label: "Mes promotions" }, ] as const; export type EspaceTab = (typeof TABS)[number]["key"]; /** * Bandeau de l'espace adhérent et onglets Profil / Promotions : deux pages * distinctes pour que la fiche publique et la vie des promotions ne se * mélangent pas dans une seule longue page. */ export function EspaceHeader({ memberName, subtitle, active, publicPath, promoBadge, }: { memberName: string; subtitle: string; active: EspaceTab; publicPath?: string | null; /** Nombre de promotions en ligne, affiché sur l'onglet. */ promoBadge?: number; }) { return (
{initialsOf(memberName)}
{memberName}
{subtitle}
{publicPath && ( Voir ma fiche publique ↗ )}
); }