// Prodz — Onboarding. Minimal required fields (role, city), progressive // enrichment after (brief §2.5 / §3.1). Bilingual; language is chosen first. function Onboarding({ onComplete }) { const { L, lang, setLang } = useL(); const { Button } = window.ProdzDesignSystem_d0b87b; const [step, setStep] = useStateS(0); // 0 = welcome, 1..4 = fields const [role, setRole] = useStateS(null); const [city, setCity] = useStateS(null); const [cityQ, setCityQ] = useStateS(''); const [interests, setInterests] = useStateS([]); const [goal, setGoal] = useStateS(null); const TOTAL = 4; const finish = () => onComplete({ role, city, interests, goal }); // ---- Welcome / language ---- if (step === 0) { return (
Prodz.

{L('La rete di chi fa cinema e fotografia.', 'The network for film & photo people.')}

{L('Portfolio, opportunità e collaborazioni in un solo posto. Costruisci il profilo in un minuto.', 'Portfolio, opportunities and collaborations in one place. Build your profile in a minute.')}

{L('Lingua', 'Language')}
{[{ id: 'it', label: 'Italiano', flag: '🇮🇹' }, { id: 'en', label: 'English', flag: '🇬🇧' }].map((o) => ( ))}
); } // ---- Field steps ---- const canNext = step === 1 ? !!role : step === 2 ? !!city : true; const optional = step >= 3; return (
{/* header: progress */}
{L('Passo', 'Step')} {step}/{TOTAL}
{Array.from({ length: TOTAL }).map((_, i) => ( ))}

{step === 1 && L('Cosa fai?', 'What do you do?')} {step === 2 && L('Dove ti trovi?', 'Where are you based?')} {step === 3 && L('Cosa ti interessa?', 'What are you into?')} {step === 4 && L('Perché sei qui?', 'Why are you here?')}

{optional ? L('Opzionale', 'Optional') : L('Obbligatorio', 'Required')}

{step === 1 && L('Il tuo ruolo principale. Personalizza feed e Shoutouts.', 'Your primary role. It tunes your feed and Shoutouts.')} {step === 2 && L('Per connetterti con chi lavora vicino a te.', 'To connect you with people working nearby.')} {step === 3 && L('Scegli almeno 3. Affina le opportunità che vedi.', 'Pick at least 3. It sharpens the opportunities you see.')} {step === 4 && L('Ci aiuta a darti la versione giusta della piattaforma.', 'Helps us give you the right version of the platform.')}

{/* STEP 1 — role */} {step === 1 && (
{ROLES.map((r) => { const sel = role && role.it === r.it; return setRole(r)}>{tr(L, r)}; })}
)} {/* STEP 2 — city */} {step === 2 && (
setCityQ(e.target.value)} placeholder={L('Cerca la tua città…', 'Search your city…')} style={{ flex: 1, background: 'none', border: 'none', outline: 'none', color: 'var(--text-body)', fontSize: 14 }} />
{CITIES.filter((c) => c.toLowerCase().includes(cityQ.toLowerCase())).map((c) => ( setCity(c)} icon="MapPin">{c} ))}
)} {/* STEP 3 — interests */} {step === 3 && (
{INTERESTS.map((it) => { const sel = interests.some((x) => x.it === it.it); return setInterests((arr) => sel ? arr.filter((x) => x.it !== it.it) : [...arr, it])}>{tr(L, it)}; })}
)} {/* STEP 4 — goal */} {step === 4 && (
{GOALS.map((g) => { const sel = goal && goal.label.it === g.label.it; return ( ); })}
)} {step === TOTAL && (

{L('Potrai arricchire il profilo più avanti, mentre usi l’app.', 'You can enrich your profile later, as you use the app.')}

)}
{/* footer */}
{step < TOTAL ? (
{optional && }
) : ( )}
); } function Chip({ children, selected, onClick, icon }) { return ( ); } Object.assign(window, { Onboarding, Chip });