'use client';

import { useAuth } from '@client/contexts/AuthContext';
import { formatCurrency, formatCurrencyCompact, getCurrencySymbol } from '@client/utils/formatCurrency';

export function useCurrency() {
  const { userRecord } = useAuth();
  const code = userRecord?.restaurants?.currency || 'USD';

  return {
    code,
    symbol: getCurrencySymbol(code),
    format: (amount: number) => formatCurrency(amount, code),
    formatCompact: (amount: number) => formatCurrencyCompact(amount, code),
  };
}
