import { useTranslation } from 'react-i18next';

export default function LanguageSwitcher() {
  const { i18n } = useTranslation();

  const changeLang = (e: React.ChangeEvent<HTMLSelectElement>) => {
    void i18n.changeLanguage(e.target.value);
  };

  return (
    <select
      aria-label="Language selector"
      onChange={changeLang}
      value={i18n.resolvedLanguage}
      className="bg-transparent text-white/80 border border-white/20 rounded-md px-2 py-1 text-sm hover:bg-white/10"
    >
      <option value="cs">CS</option>
      <option value="en">EN</option>
    </select>
  );
}
