(feat:confirm-modal) danger variant

This commit is contained in:
ManishMadan2882
2025-03-01 20:12:40 +05:30
parent b07ec8accb
commit a3b28843b6
2 changed files with 10 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ export default function ConfirmationModal({
handleSubmit,
cancelLabel,
handleCancel,
variant = 'default',
}: {
message: string;
modalState: ActiveState;
@@ -19,8 +20,15 @@ export default function ConfirmationModal({
handleSubmit: () => void;
cancelLabel?: string;
handleCancel?: () => void;
variant?: 'default' | 'danger';
}) {
const { t } = useTranslation();
const submitButtonClasses =
variant === 'danger'
? 'rounded-3xl bg-rosso-corsa px-5 py-2 text-sm text-lotion transition-all hover:bg-red-2000'
: 'rounded-3xl bg-purple-30 px-5 py-2 text-sm text-lotion transition-all hover:bg-[#6F3FD1]';
return (
<>
{modalState === 'ACTIVE' && (
@@ -39,7 +47,7 @@ export default function ConfirmationModal({
<div className="mt-6 flex flex-row-reverse gap-1">
<button
onClick={handleSubmit}
className="rounded-3xl bg-purple-30 px-5 py-2 text-sm text-white transition-all hover:bg-[#6F3FD1]"
className={submitButtonClasses}
>
{submitLabel}
</button>

View File

@@ -42,6 +42,7 @@ export default function DeleteConvModal({
submitLabel={t('modals.deleteConv.delete')}
handleSubmit={handleSubmit}
handleCancel={handleCancel}
variant="danger"
/>
);
}