import { Alert, AlertDescription } from '@documenso/ui/primitives/alert'; import { Button } from '@documenso/ui/primitives/button'; import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@documenso/ui/primitives/dialog'; import { Trans } from '@lingui/react/macro'; import { useState } from 'react'; export type DocumentPreferencesResetDialogProps = { disabled?: boolean; isSubmitting: boolean; onReset: () => Promise; showAiFeatures?: boolean; showDocumentVisibility?: boolean; showIncludeSenderDetails?: boolean; trigger?: React.ReactNode; }; export const DocumentPreferencesResetDialog = ({ disabled = false, isSubmitting, onReset, showAiFeatures = false, showDocumentVisibility = false, showIncludeSenderDetails = false, trigger, }: DocumentPreferencesResetDialogProps) => { const [open, setOpen] = useState(false); const [isResetting, setIsResetting] = useState(false); const isLoading = isSubmitting || isResetting; const handleResetToDefaults = async () => { setIsResetting(true); try { await onReset(); setOpen(false); } finally { setIsResetting(false); } }; return ( !isLoading && setOpen(value)}> {trigger ?? ( )} Reset document preferences This will reset all document preferences to their default values and save the changes immediately.

Once confirmed, the following will be reset:

    {showDocumentVisibility && (
  • Default document visibility
  • )}
  • Default document language
  • Default date format
  • Default time zone
  • Default signature settings
  • {showIncludeSenderDetails && (
  • Send on behalf of team
  • )}
  • Include the signing certificate in the document
  • Include the audit logs in the document
  • Default recipients
  • Delegate document ownership
  • Default envelope expiration
  • Default signing reminders
  • {showAiFeatures && (
  • AI features
  • )}
); };