Files
buzz-sheet/components/admin/delete-condition-dialog.tsx
gunshiz e0794822b1
CI / Verify (push) Successful in 1m18s
CI / Build immutable images and deploy (push) Successful in 1m57s
feat(i18n) : add personal languages and compact weapon exports
2026-09-14 16:44:44 +07:00

36 lines
1.1 KiB
TypeScript

"use client";
import { useTranslation } from "@/components/i18n/locale-provider";
import type { ComponentProps } from "react";
import { Trash2Icon } from "lucide-react";
import { DeleteConfirmationDialog } from "@/components/admin/delete-confirmation-dialog";
type DeleteConditionDialogProps = Pick<
ComponentProps<typeof DeleteConfirmationDialog>,
"trigger" | "onConfirm"
> & {
iconOnly?: boolean;
};
export function DeleteConditionDialog({
trigger,
onConfirm,
iconOnly = false,
}: DeleteConditionDialogProps) {
const { t } = useTranslation();
return (
<DeleteConfirmationDialog
trigger={trigger}
triggerTooltip={iconOnly ? t("ลบ Condition นี้") : undefined}
title={t("ลบ Condition นี้?")}
description={t("ข้อมูลทั้งหมดใน Condition นี้จะถูกลบออก")}
showSuccessToast
onConfirm={onConfirm}
>
<Trash2Icon data-icon={iconOnly ? undefined : "inline-start"} />
<span className={iconOnly ? "sr-only" : undefined}>{t("ลบ Condition นี้")}</span>
</DeleteConfirmationDialog>
);
}