informe-comercial-alfa/app/layout.js
2026-09-21 17:11:53 -06:00

54 lines
1.7 KiB
JavaScript

import "./globals.css";
import { auth, signIn, signOut } from "./lib/auth";
import AppShell from "./components/AppShell";
export const metadata = {
title: "Informe Comercial ALFA+",
description: "Analítica comercial en vivo sobre Dynamics 365",
};
const PAGES = [
{ href: "/", label: "Resumen Ejecutivo", ico: "▣", built: true },
{ href: "/tendencia", label: "Tendencia / Caída", ico: "📈", built: true },
{ href: "/ganadas", label: "Ventas Ganadas", ico: "▲", built: true },
{ href: "/perdemos", label: "Por qué Perdemos", ico: "▼", built: true },
{ href: "/tuberia", label: "Tubería Activa", ico: "▤", built: true },
{ href: "/prevision", label: "Previsión de Ventas", ico: "◎", built: true },
{ href: "/mapa", label: "Mapa Geográfico", ico: "◈", built: false },
{ href: "/precio", label: "Precio por Mbps", ico: "⊟", built: false },
{ href: "/detalle", label: "Detalle", ico: "☰", built: true },
];
export default async function RootLayout({ children }) {
const session = await auth();
async function handleSignIn() {
"use server";
await signIn("microsoft-entra-id");
}
async function handleSignOut() {
"use server";
await signOut();
}
return (
<html lang="es">
<head>
<link rel="stylesheet" href="/assets/css/base.css" />
<link rel="stylesheet" href="/assets/css/layout.css" />
<link rel="stylesheet" href="/assets/css/components.css" />
</head>
<body>
<AppShell
pages={PAGES}
session={session?.email ? { email: session.email, isAdmin: session.isAdmin } : null}
onSignIn={handleSignIn}
onSignOut={handleSignOut}
>
{children}
</AppShell>
</body>
</html>
);
}