);
// Mini sparkline
const Spark = ({ data, stroke = '#a78bfa', fill = 'rgba(139,92,246,.15)', height = 40 }) => {
const max = Math.max(...data), min = Math.min(...data);
const w = 120, h = height;
const pts = data.map((v, i) => [i * (w / (data.length - 1)), h - ((v - min) / (max - min || 1)) * (h - 4) - 2]);
const path = pts.map((p, i) => (i === 0 ? `M${p[0]},${p[1]}` : `L${p[0]},${p[1]}`)).join(' ');
const area = path + ` L${w},${h} L0,${h} Z`;
return (
);
};
// Donut chart
const Donut = ({ segments, size = 140, thickness = 18 }) => {
const r = (size - thickness) / 2;
const c = 2 * Math.PI * r;
const total = segments.reduce((s, x) => s + x.value, 0);
let offset = 0;
return (
);
};
// Bar chart
const Bars = ({ series, labels, height = 200 }) => {
const max = Math.max(...series.flatMap(s => s.data));
return (
{labels.map((lbl, i) => (
{series.map((s, si) => (
))}
{lbl}
))}
{series.map((s, i) => (
{s.name}
))}
);
};
// ==================== 1. Dashboard Executivo ====================
const DashExecutivo = ({ onNavigate }) => (
Consolidado pela IA · atualizado há 12 min>}
title="Dashboard Executivo"
subtitle="Visão estratégica consolidada de todas as áreas — use para reuniões de diretoria e tomada de decisão semanal."
actions={<>
>}
>
{/* Top KPIs */}