"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface TaskItem { id: string; label: string; done?: boolean; assignee?: string; priority?: "low" | "med" | "high"; } export interface BoardChecklistProps extends Omit, "onToggle"> { title?: string; items: TaskItem[]; onToggle?: (id: string) => void; } const PRIORITY_TONE: Record, string> = { low: "border-border bg-secondary text-muted-foreground", med: "border-warning/50 bg-warning/10 text-warning", high: "border-destructive/50 bg-destructive/10 text-destructive", }; const PRIORITY_LABEL: Record, string> = { low: "Low", med: "Med", high: "High" }; /** Task checklist: checkbox + assignee + priority + progress. */ export function BoardChecklist({ title = "Tasks", items, onToggle, className, ...props }: BoardChecklistProps) { const [list, setList] = React.useState(items); React.useEffect(() => setList(items), [items]); const doneCount = list.filter((i) => i.done).length; const pct = Math.round((doneCount / Math.max(1, list.length)) * 100); const toggle = (id: string) => { const next = list.map((i) => (i.id === id ? { ...i, done: !i.done } : i)); setList(next); onToggle?.(id); }; return (

{title}

{doneCount}/{list.length}
    {list.map((item, idx) => (
  • ))}
); }