// Bellia — Dashboard (variante B : nav pill flottante + hero CA orange + KPI grid) const ALERTS = [ { kind: 'err', agent: 'Comptabilité', t: 'Food cost en dérive : 32 % vs cible 28 %', age: 'il y a 2 h' }, { kind: 'warn', agent: 'Fournisseurs', t: '4 factures Métro à valider avant vendredi', age: 'il y a 5 h' }, { kind: 'warn', agent: 'Planning', t: 'Le planning S+1 n\'est pas encore publié', age: 'hier' }, { kind: 'ok', agent: 'TVA', t: 'La TVA d\'avril est prête à exporter', age: 'hier' }, ]; const RECENT = [ { who: 'Marc D.', what: 'a clôturé le ticket Z', when: 'il y a 12 min', a: 'MD', c: C.orangeDp }, { who: 'Aline L.', what: 'a saisi la facture Métro #4218', when: 'il y a 1 h', a: 'AL', c: C.warn }, { who: 'Bellia IA', what: 'a généré le rapport hebdo', when: 'ce matin', a: 'b', c: C.orange }, { who: 'Théo R.', what: 'a publié le planning S+0', when: 'hier 18:30', a: 'TR', c: C.ok }, ]; const DashboardScreen = ({ onNav }) => { const [period, setPeriod] = React.useState('mois'); const todayCA = 4280; return (
}>Exporter} /> {/* ====== HERO + 3 KPIs ====== */}
{/* Hero CA orange */}
CA DU JOUR · TTC
{eur(todayCA)}
}>+12,3 % vs hier 147 tickets · panier moyen {eur(29.12, 2)}
{/* mini chart blanc */}
{(() => { const data = SALES_30.slice(-14); const max = Math.max(...data) * 1.1; const pts = data.map((v, i) => [i * (600 / (data.length - 1)), 130 - (v / max) * 110]); const linePath = pts.map((p, i) => `${i === 0 ? 'M' : 'L'}${p[0].toFixed(1)},${p[1].toFixed(1)}`).join(' '); const areaPath = `${linePath} L600,130 L0,130 Z`; return ( <> {pts.map((p, i) => ( ))} ); })()}
{/* 3 KPI verticaux */}
v * 0.68)} sparkAccent={C.orange} />
{/* ====== ROW 2 ====== */}
Chiffre d'affaires — 30 derniers jours
République · comparaison avec mai 2025
Alertes des agents IA
4 actions proactives
2 urgentes
{ALERTS.map((a, i) => ( ))}
{/* ====== ROW 3 — secondary metrics + activity ====== */}
Modes de vente
Mai 2026
{[ { l: 'Sur place', v: '65 %', c: C.orange }, { l: 'Click & collect', v: '20 %', c: C.orangeDp }, { l: 'Livraison', v: '15 %', c: C.warn }, ].map(s => (
{s.l} {s.v}
))}
Équipe en service
Aujourd'hui · 12 sur 18
À jour
12
/ 18
{[ { i: 'MD', c: C.orange }, { i: 'AL', c: C.orangeDp }, { i: 'TR', c: C.warn }, { i: 'SN', c: C.ok }, { i: 'JB', c: C.mute }, ].map((p, k) => (
))} +7 autres
Cuisine 8 · Salle 4
Activité récente
{RECENT.map((r, i) => (
{r.who} {r.what}
{r.when}
))}
); }; // ----- support components ----- const KpiCard = ({ label, value, delta, deltaKind = 'ok', spark, sparkAccent = C.orange, alert, progress, progressColor }) => (
{label.toUpperCase()}
{value}
: deltaKind === 'ok' ? : null}>{delta}
{spark &&
} {progress != null && (
)}
); const AlertRow = ({ kind, agent, t, age }) => { const map = { err: { c: C.err, bg: C.errSft }, warn: { c: C.warn, bg: C.warnSft }, ok: { c: C.ok, bg: C.okSft } }; const s = map[kind]; return (
{t}
{age} · agent {agent}
); }; const Legend = ({ dot, label, dashed }) => (
{dashed ? : } {label}
); const Stat = ({ label, value, delta, deltaPlain }) => (
{label.toUpperCase()}
{value}
{delta}
); window.DashboardScreen = DashboardScreen;