import Avatar from "~/components/Avatar"; import Badge from "~/components/Badge"; import CircularProgress from "~/components/CircularProgress"; import LabelIcon from "~/components/LabelIcon"; import { getAvatarUrl } from "~/utils/helpers"; const Card = ({ title, labels, members, checklists, }: { title: string; labels: { name: string; colourCode: string | null }[]; members: { publicId: string; email: string; user: { name: string | null; email: string; image: string | null } | null; }[]; checklists: { publicId: string; name: string; items: { publicId: string; title: string; completed: boolean; index: number; }[]; }[]; }) => { const completedItems = checklists.reduce((acc, checklist) => { return acc + checklist.items.filter((item) => item.completed).length; }, 0); const totalItems = checklists.reduce((acc, checklist) => { return acc + checklist.items.length; }, 0); const progress = totalItems > 0 ? Math.round((completedItems / totalItems) * 100) : 0; return (