mirror of
https://github.com/documenso/documenso.git
synced 2026-07-24 17:04:12 +10:00
feat: update branding preferences reset dialog with disabled state integration
This commit is contained in:
@@ -14,6 +14,7 @@ import { Trans } from '@lingui/react/macro';
|
||||
import { useState } from 'react';
|
||||
|
||||
export type BrandingPreferencesResetDialogProps = {
|
||||
disabled?: boolean;
|
||||
hasAdvancedBranding: boolean;
|
||||
isSubmitting: boolean;
|
||||
onReset: () => Promise<void>;
|
||||
@@ -21,6 +22,7 @@ export type BrandingPreferencesResetDialogProps = {
|
||||
};
|
||||
|
||||
export const BrandingPreferencesResetDialog = ({
|
||||
disabled = false,
|
||||
hasAdvancedBranding,
|
||||
isSubmitting,
|
||||
onReset,
|
||||
@@ -43,10 +45,10 @@ export const BrandingPreferencesResetDialog = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(value) => !isLoading && setOpen(value)}>
|
||||
<Dialog open={open} onOpenChange={(value) => !isLoading && !disabled && setOpen(value)}>
|
||||
<DialogTrigger asChild>
|
||||
{trigger ?? (
|
||||
<Button variant="destructive" type="button">
|
||||
<Button variant="destructive" type="button" disabled={disabled || isLoading}>
|
||||
<Trans>Reset</Trans>
|
||||
</Button>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user