import { conversations } from "#/features/support/mock-conversations"; import { useWorkspaceState } from "#/features/workspace/workspace-state"; export function DailyBrief({ onOpenContact }: { onOpenContact: (id: string) => void }) { const { tasks, statuses, entries } = useWorkspaceState(); const focus = tasks.find((task) => task.section === "focus" && task.status === "todo"); const optional = tasks.find((task) => task.section === "optional" && task.status === "todo"); const contacts = conversations.filter((person) => (statuses[person.id] ?? "now") === "now"); const firstContact = contacts[0]; const resume = entries.find( (entry) => entry.kind === "再開地点" && !entries.some((other) => other.correctionOf === entry.id), ); return (

{focus ? `Start with “${focus.title}” today.` : "There are no priority tasks right now."} {firstContact ? ( <> {" "} {contacts.length > 1 ? ` — one of ${contacts.length} conversations to review.` : " when you’re ready."} ) : ( " There are no conversations awaiting your attention." )}

{resume ? (

Your resume note: “ {resume.text.length > 100 ? `${resume.text.slice(0, 100)}…` : resume.text}”

) : optional ? (

“{optional.title}” can wait until you have room.

) : null}
); }