import { cn } from '@/lib/cn'; import type { Task } from '@/lib/types'; interface TaskListViewProps { tasks: Task[]; onTaskClick: (task: Task) => void; } const priorityColors: Record = { critical: 'text-error', high: 'text-warning', medium: 'text-blue-400', low: 'text-text-muted', }; const statusColors: Record = { 'not-started': 'text-gray-400', 'in-progress': 'text-blue-400', blocked: 'text-error', done: 'text-success', cancelled: 'text-gray-500', }; export function TaskListView({ tasks, onTaskClick }: TaskListViewProps): React.ReactElement { if (tasks.length === 0) { return

No tasks found

; } return (
{tasks.map((task) => ( onTaskClick(task)} className="cursor-pointer border-b border-surface-border transition-colors last:border-b-0 hover:bg-surface-elevated" > ))}
Title Status Priority Due
{task.title} {task.status} {task.priority} {task.dueDate ? new Date(task.dueDate).toLocaleDateString() : '—'}
); }