import { useTranslation as useI18NextTranslation } from 'react-i18next';

/**
 * Custom hook that wraps react-i18next's useTranslation hook
 * Provides type-safe translation function with namespace support
 */
export function useTranslation(namespace?: string) {
  const { t, i18n } = useI18NextTranslation(namespace);

  return {
    t,
    i18n,
    language: i18n.language,
    changeLanguage: i18n.changeLanguage,
  };
}
