/**
 * ANNOTATED COPY — every line explained
 * Source: src/hooks/useTranslation.ts
 * NOT used by the app — read this to learn how the real file works
 */
// Next.js: this file runs in the BROWSER (needs useState, onClick, localStorage, etc.)
'use client';
// (blank line — separates logical blocks for readability)
// Import React — core UI library (components, hooks, JSX)
import { useMemo } from 'react';
// Import project module (@/ alias = src/ folder in tsconfig)
import { createTranslator } from '@/i18n';
// Import project module (@/ alias = src/ folder in tsconfig)
import { useLocaleStore } from '@/store/locale';
// (blank line — separates logical blocks for readability)
// Named export — utility function other files can import
export function useTranslation() {
  // Zustand selector — subscribe to slice of global store
  const locale = useLocaleStore((s) => s.locale);
// (blank line — separates logical blocks for readability)
  // React useMemo — cache expensive computed value until dependencies change
  const t = useMemo(() => createTranslator(locale), [locale]);
// (blank line — separates logical blocks for readability)
  // Return value from function
  return { t, locale };
// Closing brace — end of block (function, if, object, JSX)
}
