'use client';

import { usePathname } from 'next/navigation';
import { getTranslations, getLocaleFromPathname, type Locale } from '../lib/i18n';

export function useTranslations() {
    const pathname = usePathname();
    const locale = getLocaleFromPathname(pathname);
    const { t } = getTranslations(locale);

    return { t, locale };
}

// For static export, we'll default to Finnish
export function useTranslationsStatic() {
    const { t } = getTranslations('fi');
    return { t, locale: 'fi' as Locale };
}
