import { motion } from 'framer-motion'; import { useClientTasks } from '../../../../shared/hooks/useClient360'; import styles from './Tasks.module.css'; /** * Tasks Tab * Timeline: TODAY → UPCOMING → COMPLETED * Tasks are AI-generated or manually created reminders. * "Done" and "Snooze" are the only actions — no task configuration UI. */ interface TasksTabProps { personId: string; } export function TasksTab({ personId }: TasksTabProps) { const { tasks, isLoading, markDone, snooze } = useClientTasks(personId); const today = tasks.filter(t => t.group === 'today'); const upcoming = tasks.filter(t => t.group === 'upcoming'); const completed = tasks.filter(t => t.group === 'completed'); if (isLoading) { return (
{[0, 1, 2].map(i =>
)}
); } return (
{today.length > 0 && ( )} {upcoming.length > 0 && ( )} {completed.length > 0 && ( )} {tasks.length === 0 && (

No tasks yet — create one to stay on track.

)}
); } interface Task { id: string; label: string; dueAt?: string; group: 'today' | 'upcoming' | 'completed'; isAIGenerated?: boolean; } function TaskGroup({ label, tasks, dim = false, onDone, onSnooze, }: { label: string; tasks: Task[]; dim?: boolean; onDone?: (id: string) => void; onSnooze?: (id: string) => void; }) { return (

{label}

{tasks.map((task, i) => ( {dim ? '✓' : '○'}
{task.label} {task.dueAt && ( {task.dueAt} )} {task.isAIGenerated && ( ✦ AI )}
{!dim && onDone && onSnooze && (
)}
))}
); }