"use client"; import { useSortable } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { Avatar, AvatarFallback, AvatarImage, Badge, Card, CardContent, } from "@mdxui/primitives"; import { cn } from "@mdxui/primitives/lib/utils"; import { format, isPast, isToday } from "date-fns"; import { AlertCircle, Calendar } from "lucide-react"; import type { KanbanCard } from "./types"; interface KanbanCardProps { card: KanbanCard; columnId: string; index?: number; onClick?: () => void; isDragging?: boolean; } const priorityColors = { low: "bg-blue-500/10 text-blue-700 dark:text-blue-400", medium: "bg-yellow-500/10 text-yellow-700 dark:text-yellow-400", high: "bg-orange-500/10 text-orange-700 dark:text-orange-400", urgent: "bg-red-500/10 text-red-700 dark:text-red-400", }; export function KanbanCardComponent({ card, columnId, index = 0, onClick, isDragging = false, }: KanbanCardProps) { const { attributes, listeners, setNodeRef, transform, transition, isDragging: isSortableDragging, } = useSortable({ id: card.id, data: { type: "card", card, columnId, index, }, }); const style = { transform: CSS.Transform.toString(transform), transition, }; const isOverdue = card.dueDate && isPast(card.dueDate) && !isToday(card.dueDate); return (
{card.description}
)}