34 lines
1017 B
TypeScript
34 lines
1017 B
TypeScript
"use client";
|
|
|
|
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) {
|
|
return (
|
|
<DeleteConfirmationDialog
|
|
trigger={trigger}
|
|
triggerTooltip={iconOnly ? "ลบ Condition นี้" : undefined}
|
|
title="ลบ Condition นี้?"
|
|
description="ข้อมูลทั้งหมดใน Condition นี้จะถูกลบออก"
|
|
showSuccessToast
|
|
onConfirm={onConfirm}
|
|
>
|
|
<Trash2Icon data-icon={iconOnly ? undefined : "inline-start"} />
|
|
<span className={iconOnly ? "sr-only" : undefined}>ลบ Condition นี้</span>
|
|
</DeleteConfirmationDialog>
|
|
);
|
|
}
|