import type { TranslationKeys } from 'i18n';
import type { InterpolationParams } from 'i18n';
import { useTranslation as useTranslationBase } from 'i18n';
import type en from '../locales/en.json';

type AppTranslationKey = TranslationKeys<typeof en>;

export const useTranslation = () => {
  const { t: baseT, locale } = useTranslationBase();
  const t = (key: AppTranslationKey, params?: InterpolationParams) => baseT(key, params);
  return { t, locale };
};
