// Reflect screen — evening check-in const { useState: useState_R } = React; function ReflectScreen({ onSubmitted }) { const [rating, setRating] = useState_R(0); const [word, setWord] = useState_R(""); const [moved, setMoved] = useState_R(null); const [journal, setJournal] = useState_R(""); const [submitting, setSubmitting] = useState_R(false); const [done, setDone] = useState_R(false); const canSubmit = rating > 0 && word.trim() && moved !== null && !submitting; const submit = async () => { if (!canSubmit) return; setSubmitting(true); try { await api.submitReflect({ rating, word: word.trim(), moved: moved === "YES", journal: journal.trim() || undefined, }); } catch (e) { console.warn("reflect submit failed:", e); } setDone(true); setTimeout(() => onSubmitted(), 900); }; return (
{(() => { const d = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][new Date().getDay()]; const h = new Date().getHours(); const part = h < 12 ? "morning" : h < 17 ? "afternoon" : h < 21 ? "evening" : "night"; return `${d} ${part}`; })()}
How did today land?
Rate the session
One word for today
setWord(e.target.value)} maxLength={24} />
Did you move your body?
Anything on your mind?