import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"

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

export function formatPence(pence: number): string {
  return `£${(pence / 100).toFixed(2)}`
}

export function formatPenceShort(pence: number): string {
  const pounds = pence / 100
  if (pounds >= 1000) return `£${(pounds / 1000).toFixed(pounds % 1000 === 0 ? 0 : 1)}k`
  return `£${pounds.toFixed(0)}`
}
