/**
 * ANNOTATED COPY — every line explained
 * Source: src/lib/utils.ts
 * NOT used by the app — read this to learn how the real file works
 */
// Import external package or local module
import { clsx, type ClassValue } from 'clsx';
// (blank line — separates logical blocks for readability)
// Named export — utility function other files can import
export function cn(...inputs: ClassValue[]) {
  // Return value from function
  return clsx(inputs);
// Closing brace — end of block (function, if, object, JSX)
}
// (blank line — separates logical blocks for readability)
// Named export — utility function other files can import
export function formatPrice(price: number, locale = 'sv-SE'): string {
  // Return value from function
  return new Intl.NumberFormat(locale, {
    // Property or array item — trailing comma allowed in TypeScript
    style: 'currency',
    // Property or array item — trailing comma allowed in TypeScript
    currency: 'SEK',
  // Closing brace — end of block (function, if, object, JSX)
  }).format(price);
// Closing brace — end of block (function, if, object, JSX)
}
// (blank line — separates logical blocks for readability)
// Named export — utility function other files can import
export function getFormatLocale(locale: string): string {
  // Line 15: const map: Record<string, string> = {
  const map: Record<string, string> = {
    // Property or array item — trailing comma allowed in TypeScript
    en: 'en-US',
    // Property or array item — trailing comma allowed in TypeScript
    sv: 'sv-SE',
    // Property or array item — trailing comma allowed in TypeScript
    ur: 'ur-PK',
  // Closing brace — end of block (function, if, object, JSX)
  };
  // Return value from function
  return map[locale] ?? 'en-US';
// Closing brace — end of block (function, if, object, JSX)
}
// (blank line — separates logical blocks for readability)
// Named export — utility function other files can import
export function formatDate(date: string): string {
  // Return value from function
  return new Intl.DateTimeFormat('en-US', {
    // Property or array item — trailing comma allowed in TypeScript
    year: 'numeric',
    // Property or array item — trailing comma allowed in TypeScript
    month: 'long',
    // Property or array item — trailing comma allowed in TypeScript
    day: 'numeric',
  // Closing brace — end of block (function, if, object, JSX)
  }).format(new Date(date));
// Closing brace — end of block (function, if, object, JSX)
}
