mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
(feat:confirm-modal) danger variant
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -42,6 +42,7 @@ export default function DeleteConvModal({
|
||||
submitLabel={t('modals.deleteConv.delete')}
|
||||
handleSubmit={handleSubmit}
|
||||
handleCancel={handleCancel}
|
||||
variant="danger"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user