function ChatScreen(){ const [msgs,setMsgs] = React.useState([ {from:'agent',text:"Morning. You've got a late meeting today — want dinner moved to 20:30 and made lighter?",time:'07:12',chips:['Yes, move it','Keep as is']}, {from:'user',text:'Move it, and something I can cook in 15 minutes.',time:'07:14'}, {from:'agent',text:'Done. Miso salmon with greens and rice — 15 minutes, 610 kcal, hits your protein target for the day.',time:'07:14'}, ]); const [typing,setTyping] = React.useState(false); const [draft,setDraft] = React.useState(''); const send = (text) => { if(!text.trim()) return; setMsgs(m=>[...m,{from:'user',text,time:'09:04'}]); setDraft(''); setTyping(true); setTimeout(()=>{ setTyping(false); setMsgs(m=>[...m,{from:'agent',text:"Swapped it — Thursday's dinner is now lentil ragù. That covers the iron gap too.",time:'09:04',chips:['Show recipe','Undo']}]); },1400); }; return (
); } Object.assign(window,{ChatScreen});