Component properties
Props for the ResetSettingsDialog component
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>
);
}
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.