From a752dfd059871a184cc102fb0bf5002490b4c49d Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 01:02:57 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/tasks.index.tsx | 50 +++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/src/routes/tasks.index.tsx b/src/routes/tasks.index.tsx index 38b4b13..e729a45 100644 --- a/src/routes/tasks.index.tsx +++ b/src/routes/tasks.index.tsx @@ -18,7 +18,7 @@ import { import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { Plus, Search, Calendar as CalIcon, AlertCircle } from "lucide-react"; -import { format, isBefore, startOfDay, isSameDay, addDays } from "date-fns"; +import { format, isBefore, startOfDay, isSameDay, addDays, differenceInCalendarDays } from "date-fns"; import { TaskDetailPanel } from "@/components/tasks/task-detail-panel"; import { NewTaskDialog } from "@/components/tasks/new-task-dialog"; import { cn } from "@/lib/utils"; @@ -280,6 +280,22 @@ function TasksPage() { {items.map((t) => { const ids = assigneesByTask[t.id] || []; const c = t.case_id ? casesById[t.case_id] : null; + const assigneeNames = ids + .map((uid) => profilesById[uid]) + .filter(Boolean) + .map((p) => p.full_name || p.email); + let countdown: { label: string; tone: string } | null = null; + if (t.due_date && t.status !== "complete") { + const days = differenceInCalendarDays(startOfDay(new Date(t.due_date)), startOfDay(new Date())); + if (days < 0) + countdown = { + label: `${Math.abs(days)}d overdue`, + tone: "text-destructive", + }; + else if (days === 0) countdown = { label: "Due today", tone: "text-orange-600" }; + else if (days === 1) countdown = { label: "Due tomorrow", tone: "text-orange-600" }; + else countdown = { label: `in ${days}d`, tone: "text-muted-foreground" }; + } return (