import type { Card, Column, Label } from "@/types/board"; import { LabelDots } from "@/components/board/LabelDots"; import { ChecklistBar } from "@/components/board/ChecklistBar"; import { format, isPast, isToday } from "date-fns"; interface CardOverlayProps { card: Card; boardLabels: Label[]; } export function CardOverlay({ card, boardLabels }: CardOverlayProps) { const hasDueDate = card.dueDate != null; const dueDate = hasDueDate ? new Date(card.dueDate!) : null; const overdue = dueDate != null && isPast(dueDate) && !isToday(dueDate); return (
{/* Label dots */} {card.labels.length > 0 && (
)} {/* Card title */}

{card.title}

{/* Footer row: due date + checklist */} {(hasDueDate || card.checklist.length > 0) && (
{dueDate && ( {format(dueDate, "MMM d")} )} {card.checklist.length > 0 && ( )}
)}
); } interface ColumnOverlayProps { column: Column; } export function ColumnOverlay({ column }: ColumnOverlayProps) { return (
{column.title} {column.cardIds.length}
{column.cardIds.slice(0, 3).map((_, i) => (
))} {column.cardIds.length > 3 && (

+{column.cardIds.length - 3} more

)}
); }