export function Simulator() { const { copy } = useLang() const [state, setState] = useState({ business: null, goal: null, problem: null, level: null, }) const [active, setActive] = useState(0) const set = (patch: Partial) => setState((s) => ({ ...s, ...patch })) // Picks made in the hero diagnosis column pre-fill the simulator. useEffect(() => { const onPick = (e: Event) => { const { kind, id } = (e as CustomEvent<{ kind: string; id: string }>).detail if (kind === 'business' || kind === 'goal' || kind === 'problem') { setState((s) => ({ ...s, [kind]: id })) } } window.addEventListener('lv-pick', onPick) return () => window.removeEventListener('lv-pick', onPick) }, [])