• Settings reset confirmation dialog

    Renders a button that, when clicked, opens a confirmation dialog warning the user about the consequences of resetting settings. The dialog provides options to cancel or confirm the action.

    The primary button is styled with destructive styling to indicate the potentially harmful nature of the action.

    Parameters

    • props: ResetSettingsDialogProps

      Component properties

      Props for the ResetSettingsDialog component

      • onReset: () => void

        Callback function triggered when reset is confirmed

    Returns Element

    React component with reset button and confirmation dialog

    export function ResetSettingsDialog({ onReset }: ResetSettingsDialogProps) {
    return (
    <AlertDialog>
    <AlertDialogTrigger asChild>
    <Button variant="destructive" className="w-full">
    <RotateCcw className="mr-2 h-4 w-4" />
    Reset to Defaults
    </Button>
    </AlertDialogTrigger>
    <AlertDialogContent>
    <AlertDialogHeader>
    <AlertDialogTitle>Reset Settings</AlertDialogTitle>
    <AlertDialogDescription>
    Are you sure you want to reset all settings to their default values?
    This action cannot be undone.
    </AlertDialogDescription>
    </AlertDialogHeader>
    <AlertDialogFooter>
    <AlertDialogCancel>Cancel</AlertDialogCancel>
    <AlertDialogAction onClick={onReset}>
    Reset Settings
    </AlertDialogAction>
    </AlertDialogFooter>
    </AlertDialogContent>
    </AlertDialog>
    );
    }