import { requireClient } from "@/lib/guards";
import Shell, { type ShellNavItem } from "@/components/dashboard/Shell";

export const metadata = {
  title: "Espace client",
  robots: { index: false, follow: false },
};

const nav: ShellNavItem[] = [
  { href: "/espace-client", label: "Tableau de bord", icon: "dashboard" },
  { href: "/espace-client/dossiers", label: "Mes dossiers", icon: "folder" },
  {
    href: "/espace-client/factures",
    label: "Mes factures",
    icon: "receipt_long",
  },
];

export default async function ClientLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const session = await requireClient();

  return (
    <Shell
      brand="Socialex"
      variant="client"
      user={{ name: session.user.name, email: session.user.email }}
      nav={nav}
    >
      {children}
    </Shell>
  );
}
