/* global React, DictoIcons */
// Shell.jsx — Shared chrome for the Dicto BO wizard
// Sidebar, topbar, stepper, footer nav, preview rail
const {
IconBack, IconChevDown, IconChevRight, IconCheck,
IconPanel, IconSparkles,
IconChart, IconUsers, IconBook, IconLayers, IconTimeline,
IconTag, IconSignal, IconSpark, IconCrown, IconBolt, IconEye,
IconHash, IconBuilding, IconUser,
} = window.DictoIcons;
// Dicto logo mark (white on brand-red square, like screenshot)
const DictoMark = ({ size = 28 }) => (
);
const WIZ_STEPS_BASE = [
{ n: 1, lbl: 'Header' },
{ n: 2, lbl: 'Progetto' },
{ n: 3, lbl: 'Knowledge base' },
{ n: 4, lbl: 'Competitor' },
{ n: 5, lbl: 'Provider AI' },
{ n: 6, lbl: 'Personas' },
{ n: 7, lbl: 'Riepilogo' },
];
const WIZ_STEPS = WIZ_STEPS_BASE; // legacy export kept
function getWizSteps(tipologia) {
const step4Lbl = tipologia === 'personal' ? 'Peer'
: tipologia === 'topic' ? 'Topic affini'
: 'Competitor';
return WIZ_STEPS_BASE.map(s => s.n === 4 ? { ...s, lbl: step4Lbl } : s);
}
// Tipology palette — keep in sync with Step01 tile theme + .tipo-pill
const TIPO_COLORS = {
brand: { primary:'#DC2626', dark:'#991B1B', soft:'#FEE2E2', logo:'#DC2626' },
personal: { primary:'#059669', dark:'#065F46', soft:'#D1FAE5', logo:'#059669' },
topic: { primary:'#7C3AED', dark:'#5B21B6', soft:'#EDE9FE', logo:'#7C3AED' },
};
function Sidebar({ strategist = false, tipologia = 'brand' }) {
const colors = TIPO_COLORS[tipologia] || TIPO_COLORS.brand;
const items1 = [
{ ic: , lbl: 'Panoramica' },
{ ic: , lbl: 'Risposte AI', disabled: true },
{ ic: , lbl: 'Personas', disabled: true },
{ ic: , lbl: 'Fonti', disabled: true },
{ ic: , lbl: 'Providers', disabled: true },
{ ic: , lbl: 'Affermazioni AI', disabled: true },
{ ic: , lbl: 'Timeline', disabled: true },
];
const items2 = [
{ ic: , lbl: 'Temi', disabled: true },
{ ic: , lbl: 'Segnali Emergenti', disabled: true },
{ ic: , lbl: 'Pattern Narrativi', disabled: true },
{ ic: , lbl: 'Archetipo', disabled: true },
{ ic: , lbl: 'Dimensioni', disabled: true },
{ ic: , lbl: 'DictoScore', disabled: true },
];
return (
);
}
function Topbar({ title = 'Nuovo progetto', crumb = 'Progetti' }) {
return (
{crumb} ›
{title}
Bozza salvata
MC
);
}
function Stepper({ active = 1, done = [], tipologia = 'brand' }) {
const steps = getWizSteps(tipologia);
const colors = TIPO_COLORS[tipologia] || TIPO_COLORS.brand;
return (
{steps.map((s, i) => {
const isDone = done.includes(s.n);
const isActive = s.n === active;
const cls = 'step ' + (isActive ? 'active' : isDone ? 'done' : '');
// Active uses tipology color; done uses tipology dark; pending stays gray
const numStyle = isActive
? { background: colors.primary, color:'#fff', borderColor: colors.primary, boxShadow: `0 0 0 4px ${colors.soft}` }
: isDone
? { background: colors.dark, color:'#fff', borderColor: colors.dark }
: null;
const lblStyle = isActive ? { color: colors.dark } : null;
const connectorBg = isDone ? colors.dark : '#DDDDE2';
return (
{isDone ? : String(s.n).padStart(2,'0')}
{s.lbl}
{i < steps.length - 1 && }
);
})}
);
}
function FooterNav({ active = 1, canNext = true, nextLabel = 'Continua', onBack, onNext, onExit }) {
return (
{active} / 8 · Tutte le modifiche salvate
{active > 1 && }
);
}
// Preview rail — the live running summary
function Preview({ rows = [] }) {
return (
{rows.map((r, i) => (
))}
);
}
// Wizard frame — composition used by every artboard
function Wizard({ step, done = [], title, crumb, canNext = true, nextLabel, children, preview, strategist = false, onBack, onNext, onExit, tipologia = 'brand' }) {
return (
{children}
{preview &&
{preview}
}
);
}
window.DictoShell = { Sidebar, Topbar, Stepper, FooterNav, Preview, Wizard, WIZ_STEPS, TIPO_COLORS };