import React, { useState } from "react";
import i18n from "../../pages/i18n";

import "./language-switch.style.scss";

const LanguageSwitch = ({ t }) => {
  const changeLanguage = (lng) => {
    i18n.changeLanguage(lng);
  };

  return (
    <button
      className="btn-lng"
      onClick={() => changeLanguage(i18n.language === "lv" ? "en" : "lv")}
    >
      {i18n.language === "lv" ? "en" : "lv"}
    </button>
  );
};

export default LanguageSwitch;
