/** * @file app/(app)/summary/sections/SummaryStatusCard.tsx * @description Client component rendering the workflow status distribution progress breakdown. */ "use client"; import { LayoutDashboard } from "lucide-react"; import { COLUMNS } from "@/lib/types/task"; /** * Properties for the SummaryStatusCard component. * * @interface SummaryStatusCardProps * @property {number} totalTasks - The total number of tasks across all statuses. * @property {Record} statusCounts - A record mapping each status identifier to its respective task count. */ interface SummaryStatusCardProps { totalTasks: number; statusCounts: Record; } /** * Renders the workflow status distribution card showing progress bars, percentages, * and task counts for each individual pipeline stage. * * @param {SummaryStatusCardProps} props - The component props. * @returns {JSX.Element} The rendered summary status card component. */ export default function SummaryStatusCard({ totalTasks, statusCounts, }: SummaryStatusCardProps) { return (

Workflow Status Distribution

Task concentration across individual pipeline stages.

{COLUMNS.map((col) => { const count = statusCounts[col.id] || 0; const percentage = totalTasks > 0 ? Math.round((count / totalTasks) * 100) : 0; return (
{col.title}
{percentage}% {count} {count === 1 ? "task" : "tasks"}
); })}
); }