import { type PropsWithChildren } from 'react' import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from 'ui' interface SSLEnforcementConfirmDialogProps { isTargetEnforced: boolean isSubmitting: boolean onConfirm: () => Promise /** * Controlled mode for callers whose control can't act as the dialog trigger * (e.g. a switch, where a disabled control must never open the dialog). * Omit both, and pass `children`, to render the children as the trigger. */ open?: boolean onOpenChange?: (open: boolean) => void } export const SSLEnforcementConfirmDialog = ({ isTargetEnforced, isSubmitting, onConfirm, open, onOpenChange, children, }: PropsWithChildren) => { return ( {children !== undefined && {children}} Updating SSL enforcement involves a brief downtime A database restart is required for SSL enforcement changes to take place, and this involves a few minutes of downtime. Confirm to proceed now? Cancel {isTargetEnforced ? 'Enable SSL' : 'Disable SSL'} ) }