2024-09-01 14:01:45 +02:00
|
|
|
import { translationAtom } from "@/atoms/translations-atom";
|
|
|
|
import { useAtomValue } from "jotai";
|
2023-09-03 11:16:48 +02:00
|
|
|
import React from "react";
|
|
|
|
|
2024-10-04 11:15:54 +02:00
|
|
|
export function ResetSettingsButton() {
|
2024-09-01 14:01:45 +02:00
|
|
|
const t = useAtomValue(translationAtom);
|
2023-09-03 11:16:48 +02:00
|
|
|
return (
|
|
|
|
<div className="flex flex-col items-start gap-2">
|
2024-09-01 14:01:45 +02:00
|
|
|
<p className="text-sm font-medium">
|
2024-09-03 09:34:58 +02:00
|
|
|
{t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
|
2024-09-01 14:01:45 +02:00
|
|
|
</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();
|
2024-09-03 09:34:58 +02:00
|
|
|
alert(t("SETTINGS.RESET_SETTINGS.ALERT"));
|
2024-04-21 16:04:59 +02:00
|
|
|
}}
|
|
|
|
>
|
2024-09-03 09:34:58 +02:00
|
|
|
{t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
|
2023-09-03 11:16:48 +02:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|