Files
lotteryFront/src/components/player-money-display.tsx
kang ecb032f8cc
Some checks failed
lotteryfront CI / build (push) Has been cancelled
feat: enhance API error handling and UI improvements
- Updated `getPublicCurrencies` and `getPlayerAuthCaptcha` functions to include `skipGlobalServerError` option, improving error handling for API requests.
- Refactored the NotFoundPage component to enhance mobile responsiveness and UI consistency, integrating `PlayerMobileViewport`.
- Improved the NetworkStatusBanner and OfflineBanner components by adding player banner height reference for better layout management.
- Updated Wallet components to utilize `PlayerMoneyDisplay` for consistent currency representation and added credit mode handling in various screens.
- Enhanced the WalletScreen and Transfer screens with loading panels and credit guard logic for better user experience during wallet operations.
2026-06-22 10:50:52 +08:00

30 lines
638 B
TypeScript

"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>
);
}