"use client"; import { Trash2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "@/components/ui/alert-dialog"; import { useTranslations } from "@/lib/i18n/context"; /** * Shared single-row delete button + confirm dialog for the data- * management lists (measurements + mood). Lifted from the two * copy-pasted `DeleteButton` helpers (v1.15.13). * * The confirm copy differs per surface (a measurement vs a mood entry), * so the title/description are passed in rather than reaching for a fixed * translation key. `cancelLabel` / `confirmLabel` default to the shared * `common.*` strings. */ export function DeleteButton({ onConfirm, title, description, cancelLabel, confirmLabel, triggerTitle, className = "", iconClassName = "h-3.5 w-3.5", }: { onConfirm: () => void; title: string; description: string; cancelLabel?: string; confirmLabel?: string; /** Native hover tooltip on the trigger; defaults to the accessible name. */ triggerTitle?: string; className?: string; iconClassName?: string; }) { const { t } = useTranslations(); return ( {title} {description} {cancelLabel ?? t("common.cancel")} {confirmLabel ?? t("common.delete")} ); }