/** Super Chat 色階（對應 `giftSuperChatTheme.ts` Tailwind 主題） */
export type GiftSuperChatTier = 'blue' | 'cyan' | 'gold' | 'orange' | 'pink'

/** 依總金額分級（參考 YouTube Super Chat 色階） */
export function getGiftSuperChatTier(totalPrice: number): GiftSuperChatTier {
    const n = Math.max(0, Number(totalPrice) || 0)

    if (n <= 2000) return 'blue'
    if (n <= 5000) return 'cyan'
    if (n <= 10000) return 'gold'
    if (n <= 50000) return 'orange'
    return 'pink'
}

export function formatGiftCoinAmount(value: number): string {
    return (Number(value) || 0).toLocaleString()
}
