import { AuthFailure, ProfileError } from '@faunosteo/supabase' import { useT } from '@/i18n/useT' /** One sentence per failure kind; anything else is the generic line. */ export function useAuthFailureMessage(): (error: unknown) => string { const t = useT() return (error) => { if (error instanceof AuthFailure) return t(`auth.failure.${error.kind}`) if (error instanceof ProfileError) return t('account.error.save_failed') return t('auth.failure.unknown') } }