Files
chat_room/admin/src/components/ui/ConfirmDialog.tsx
T
mobiniqow 75a0ba593d chore: merge admin repo history into monorepo at admin/
git-subtree-dir: admin
git-subtree-mainline: 35f5084005
git-subtree-split: 9f1eccd2f7
2026-09-27 10:30:47 +03:30

46 lines
1022 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { Modal } from "./Modal";
import { Button } from "./Button";
interface ConfirmDialogProps {
open: boolean;
title: string;
description: string;
confirmLabel?: string;
loading?: boolean;
onConfirm: () => void;
onCancel: () => void;
}
export function ConfirmDialog({
open,
title,
description,
confirmLabel = "حذف کن",
loading,
onConfirm,
onCancel,
}: ConfirmDialogProps) {
return (
<Modal open={open} onClose={onCancel} title={title}>
<p className="text-[14px] text-(--color-content-secondary) leading-6 mb-6">
{description}
</p>
<div className="flex gap-2 justify-end">
<Button variant="ghost" size="sm" onClick={onCancel}>
انصراف
</Button>
<Button
size="sm"
isLoading={loading}
className="!bg-(--color-status-error) !shadow-none hover:!bg-red-700"
onClick={onConfirm}
>
{confirmLabel}
</Button>
</div>
</Modal>
);
}