import { useState } from "react";

export default function LanguageSwitchButton({
  className,
}: {
  className?: string;
}) {
  const [locale, setLocale] = useState<"ru" | "en">("ru");

  function handleClick() {
    return setLocale(locale === "ru" ? "en" : "ru");
  }

  return (
    <button
      className={`btnm bg-[#37393B99] active:bg-[#37393B80]
        lg:px-[1.667vw] lg:py-[1.181vw] lg:rounded-[0.833vw]
        md:px-[2.604vw] md:py-[1.302vw] md:rounded-[1.563vw]
        px-[5.556vw] py-[2.778vw] rounded-[3.333vw]
        ${className}
      `}
      onClick={handleClick}
    >
      {locale === "ru" ? "RU" : "EN"}
    </button>
  );
}
