Skip to content

πŸ†™ Upscayl - #1 Free and Open Source AI Image Upscaler for Linux, MacOS and Windows.

741 B
Raw Blame
import { translationAtom } from "@/atoms/translations-atom";
import { useAtomValue } from "jotai";
import React from "react";

export function ResetSettingsButton({
  hideLabel = false,
}: {
  hideLabel?: boolean;
}) {
  const t = useAtomValue(translationAtom);
  return (
    <div className="flex flex-col items-start gap-2">
      {!hideLabel && (
        <p className="text-sm font-medium">
          {t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
        </p>
      )}
      <button
        className="btn btn-primary"
        onClick={async () => {
          localStorage.clear();
          alert(t("SETTINGS.RESET_SETTINGS.ALERT"));
        }}
      >
        {t("SETTINGS.RESET_SETTINGS.BUTTON_TITLE")}
      </button>
    </div>
  );
}