'use client'; import React from 'react'; import type { Locale } from '@/lib/locale'; import { pickLocaleText } from '@/lib/locale'; import { PlatformBadge, getPlatformStyle } from '@/lib/platform-style'; export interface ChannelInfo { id: string; groupId: number; name: string; platform: string; rateMultiplier: number; description: string | null; models: string[]; features: string[]; } interface ChannelCardProps { channel: ChannelInfo; onTopUp: () => void; isDark: boolean; locale: Locale; userBalance?: number; } export default function ChannelCard({ channel, onTopUp, isDark, locale }: ChannelCardProps) { const usableQuota = (1 / channel.rateMultiplier).toFixed(2); const ps = getPlatformStyle(channel.platform); const tagCls = isDark ? ps.modelTag.dark : ps.modelTag.light; const accentCls = isDark ? ps.accent.dark : ps.accent.light; return (
{/* Header: Platform badge + Name */}

{channel.name}

{/* Rate display - prominent */}
{pickLocaleText(locale, '当前倍率', 'Rate')}
1 : {channel.rateMultiplier}

{pickLocaleText( locale, <> 1元可用约{usableQuota}美元额度 , <> 1 CNY ≈ {usableQuota} USD quota , )}

{/* Description */} {channel.description && (

{channel.description}

)}
{/* Models */} {channel.models.length > 0 && (

{pickLocaleText(locale, '支持模型', 'Supported Models')}

{channel.models.map((model) => ( {model} ))}
)} {/* Features */} {channel.features.length > 0 && (

{pickLocaleText(locale, '功能特性', 'Features')}

{channel.features.map((feature) => ( {feature} ))}
)} {/* Spacer to push button to bottom */}
{/* Top-up button */}
); }