"use client";

import { formatMinorAsCurrency } from "@/lib/money";
import { cn } from "@/lib/utils";

type PlayerMoneyDisplayProps = {
  amountMinor: number;
  currency: string;
  className?: string;
};

/** 玩家端金额展示：自适应字号 + 防大额截断 */
export function PlayerMoneyDisplay({
  amountMinor,
  currency,
  className,
}: PlayerMoneyDisplayProps) {
  return (
    <p
      className={cn(
        "font-black leading-none tabular-nums tracking-normal break-all",
        "text-[clamp(1.125rem,5vw,1.5rem)]",
        className,
      )}
    >
      {formatMinorAsCurrency(amountMinor, currency)}
    </p>
  );
}
