{t.home.plan_title}
{state.profileProgress}%
{state.user.name}
{state.user.email}
;
};
// ------- Page header -------
const PageHeader = ({eyebrow, title, subtitle, actions}) => {
return
{eyebrow &&
{eyebrow}
}
{title}
{subtitle &&
{subtitle}
}
{actions &&
{actions}
}
;
};
// ------- Section header -------
const SectionHeader = ({eyebrow, title, action}) => {
return
{eyebrow &&
{eyebrow}
}
{title &&
{title}
}
{action}
;
};
// ------- Inventory item icon (square) -------
const ItemBadge = ({icon, color, size=36}) => (
40?18:14, flexShrink:0,
}}>{icon}
);
// ------- Mini KPI -------
const KpiCell = ({num, label, tone}) =>
;
// ------- Generic dialog header -------
const DialogHeader = ({title, onClose}) => (
{title}
);
// ------- Field wrapper -------
const Field = ({label, help, children}) => (
);
// ------- Helpers -------
const fmtEur = (n, opts={}) => {
if (typeof n !== 'number') return '—';
return new Intl.NumberFormat('it-IT', {
style:'currency', currency:'EUR',
maximumFractionDigits: opts.decimals ?? 0,
}).format(n);
};
const fmtDateTime = (iso) => {
if (!iso) return '';
try { return new Date(iso).toLocaleString('it-IT', { day:'numeric', month:'short', year:'numeric', hour:'2-digit', minute:'2-digit' }); }
catch(e){ return iso; }
};
Object.assign(window, {
Icon, Monogram, MonoStack, CassettaBadge, TriggerBadge, Sidebar,
PageHeader, SectionHeader, ItemBadge, KpiCell, DialogHeader, Field,
fmtEur, fmtDateTime,
});