function OnboardingScreen({onDone}){
const [step,setStep] = React.useState(0);
const [goal,setGoal] = React.useState('cut');
const [diet,setDiet] = React.useState(['gf']);
const [meals,setMeals] = React.useState(3);
const toggle = (k)=> setDiet(d => d.includes(k) ? d.filter(x=>x!==k) : [...d,k]);
const steps = [
{eyebrow:'Step 1 of 3', title:'What are we working towards?', body:(
setGoal('cut')} />
setGoal('gi')} />
setGoal('easy')} />
)},
{eyebrow:'Step 2 of 3', title:'Anything off the table?', body:(
{[['gf','Gluten-free','wheat-off'],['df','Dairy-free','milk-off'],['veg','Vegetarian','carrot'],['nut','Nut allergy','nut-off'],['fish','No seafood','fish-off'],['halal','Halal','moon-star']].map(([k,l,ic])=>
toggle(k)}>{l})}
)},
{eyebrow:'Step 3 of 3', title:'How does your day run?', body:(
)},
];
const s = steps[step];
return (
{s.eyebrow}
{s.title}
Suko uses this on every plan it writes. You can change it any time.
{s.body}
{step>0 ? : null}
);
}
Object.assign(window,{OnboardingScreen});