diff --git a/src/components/board/CardThumbnail.tsx b/src/components/board/CardThumbnail.tsx new file mode 100644 index 0000000..d5e66b2 --- /dev/null +++ b/src/components/board/CardThumbnail.tsx @@ -0,0 +1,57 @@ +import { format, isPast, isToday } from "date-fns"; +import type { Card, Label } from "@/types/board"; +import { LabelDots } from "@/components/board/LabelDots"; +import { ChecklistBar } from "@/components/board/ChecklistBar"; + +interface CardThumbnailProps { + card: Card; + boardLabels: Label[]; +} + +export function CardThumbnail({ card, boardLabels }: CardThumbnailProps) { + const hasDueDate = card.dueDate != null; + const dueDate = hasDueDate ? new Date(card.dueDate!) : null; + const overdue = dueDate != null && isPast(dueDate) && !isToday(dueDate); + + function handleClick() { + // Card detail modal will be wired in Task 11 + console.log("Card clicked:", card.id); + } + + return ( + + ); +} diff --git a/src/components/board/ChecklistBar.tsx b/src/components/board/ChecklistBar.tsx new file mode 100644 index 0000000..bdeb045 --- /dev/null +++ b/src/components/board/ChecklistBar.tsx @@ -0,0 +1,22 @@ +import type { ChecklistItem } from "@/types/board"; + +interface ChecklistBarProps { + checklist: ChecklistItem[]; +} + +export function ChecklistBar({ checklist }: ChecklistBarProps) { + if (checklist.length === 0) return null; + + return ( +