import { clsx, type ClassValue } from 'clsx';

export function cn(...inputs: ClassValue[]) {
  return clsx(inputs);
}

export function formatPrice(price: number, locale = 'sv-SE'): string {
  return new Intl.NumberFormat(locale, {
    style: 'currency',
    currency: 'SEK',
  }).format(price);
}

export function getFormatLocale(locale: string): string {
  const map: Record<string, string> = {
    en: 'en-US',
    sv: 'sv-SE',
    ur: 'ur-PK',
    ar: 'ar-SA',
    fa: 'fa-IR',
    tr: 'tr-TR',
  };
  return map[locale] ?? 'en-US';
}

export function formatDate(date: string): string {
  return new Intl.DateTimeFormat('en-US', {
    year: 'numeric',
    month: 'long',
    day: 'numeric',
  }).format(new Date(date));
}