"use client"; import { useDroppable } from "@dnd-kit/core"; import { SortableContext, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable"; import { CSS } from "@dnd-kit/utilities"; import { Badge, Button } from "@mdxui/primitives"; import { cn } from "@mdxui/primitives/lib/utils"; import { GripVertical, Plus } from "lucide-react"; import { KanbanCardComponent } from "./kanban-card"; import type { KanbanCard, KanbanColumn } from "./types"; interface KanbanColumnProps { column: KanbanColumn; draggable: boolean; showAddButton: boolean; onCardClick?: (card: KanbanCard, columnId: string) => void; onAddCard?: (columnId: string) => void; } export function KanbanColumnComponent({ column, draggable, showAddButton, onCardClick, onAddCard, }: KanbanColumnProps) { const cardIds = column.cards.map((card) => card.id); const { attributes, listeners, setNodeRef: setSortableRef, transform, transition, isDragging: isColumnDragging, } = useSortable({ id: column.id, data: { type: "column", column, }, }); const { setNodeRef: setDroppableRef } = useDroppable({ id: column.id, data: { type: "column", column, }, }); const style = { transform: CSS.Transform.toString(transform), transition, }; const isOverLimit = column.limit !== undefined && column.cards.length >= column.limit; return (
No cards