'use client';
import { changeLanguage, TLocales } from '@/locales/translates';
import Button from '../Button';

export default function ChangeLangButton() {
  const changeLang = (lang: TLocales) => {
    changeLanguage(lang);
    window.location.reload(); // Reload to get new SSR content
  };

  return (
    <>
      <Button onClick={() => changeLang('en')}>English</Button>
      <Button onClick={() => changeLang('fa')}>فارسی</Button>
    </>
  );
}
