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 (
Suko
{typing?'Thinking…':'Knows your plan, labs and last 30 logs'}
{msgs.map((m,i)=>( send(c)}>{c}) : null}>{m.text} ))} {typing ? : null}
setDraft(e.target.value)} onKeyDown={e=> e.key==='Enter' && send(draft)} placeholder="Ask Suko anything…" style={{flex:1,minWidth:0,height:46,padding:'0 18px',borderRadius:'var(--radius-pill)',border:'1px solid var(--border-default)',background:'var(--surface-card)',fontSize:15,outline:'none'}} /> send(draft)} />
); } Object.assign(window,{ChatScreen});