1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-12-18 18:35:58 +01:00
upscayl/renderer/components/sidebar/settings-tab/reset-settings-button.tsx

24 lines
651 B
TypeScript
Raw Normal View History

import { translationAtom } from "@/atoms/translations-atom";
import { useAtomValue } from "jotai";
2023-09-03 11:16:48 +02:00
import React from "react";
export function ResetSettingsButton() {
const t = useAtomValue(translationAtom);
2023-09-03 11:16:48 +02:00
return (
<div className="flex flex-col items-start gap-2">
<p className="text-sm font-medium">
{t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
</p>
2023-09-03 11:16:48 +02:00
<button
2024-04-21 16:04:59 +02:00
className="btn btn-primary"
2023-09-03 11:16:48 +02:00
onClick={async () => {
localStorage.clear();
alert(t("SETTINGS.RESET_SETTINGS.ALERT"));
2024-04-21 16:04:59 +02:00
}}
>
{t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
2023-09-03 11:16:48 +02:00
</button>
</div>
);
}