"use client"; import { useState } from "react"; import type { ClientView } from "@/lib/client-view"; import type { Comment } from "@/db/schema"; import { ApproveButton } from "@/components/client/ApproveButton"; import { CommentList } from "@/components/client/CommentList"; import { CommentForm } from "@/components/client/CommentForm"; type Task = ClientView["phases"][number]["tasks"][number] & { phaseTitle: string; }; const COLUMNS: { id: "todo" | "in_progress" | "done"; label: string; dotClass: string; headerClass: string }[] = [ { id: "todo", label: "Da fare", dotClass: "bg-[#d4d4d8]", headerClass: "text-[#71717a]", }, { id: "in_progress", label: "In corso", dotClass: "bg-[#DEF168]", headerClass: "text-[#1A463C]", }, { id: "done", label: "Fatto", dotClass: "bg-[#1A463C]", headerClass: "text-[#1A463C]", }, ]; function TaskCard({ task, token, comments, }: { task: Task; token: string; comments: Comment[]; }) { const [expanded, setExpanded] = useState(false); const taskComments = comments.filter((c) => c.entity_id === task.id); const hasDeliverables = task.deliverables.length > 0; const hasActivity = taskComments.length > 0 || hasDeliverables; return (
{task.description}
)} {hasDeliverables && (Nessun task
)}