"use client"; import { useTranslations } from "next-intl"; import { cn } from "@/lib/utils"; import { Check } from "@/components/icons"; import type { Calendar, CalendarTask } from "@/lib/jmap/types"; interface CalendarTaskChipProps { task: CalendarTask; calendar?: Calendar; onToggleComplete?: (task: CalendarTask) => void; onSelect?: (task: CalendarTask) => void; className?: string; } /** * A task on its due day in the month and week grids (#1107). The circle * toggles completion; the title opens the task in the editor. */ export function CalendarTaskChip({ task, calendar, onToggleComplete, onSelect, className }: CalendarTaskChipProps) { const t = useTranslations("calendar"); const isCompleted = task.progress === "completed"; const color = calendar?.color || "#3b82f6"; const title = task.title || t("tasks.no_title"); return (