/** * Individual Gemini CLI quota card component. */ import { useTranslation } from 'react-i18next'; import type { GeminiCliQuotaState, AuthFileItem, ResolvedTheme, ThemeColors } from '@/types'; import { TYPE_COLORS, formatQuotaResetTime } from '@/utils/quota'; import styles from '@/pages/QuotaPage.module.scss'; interface GeminiCliCardProps { item: AuthFileItem; quota?: GeminiCliQuotaState; resolvedTheme: ResolvedTheme; getQuotaErrorMessage: (status: number | undefined, fallback: string) => string; } export function GeminiCliCard({ item, quota, resolvedTheme, getQuotaErrorMessage }: GeminiCliCardProps) { const { t } = useTranslation(); const displayType = item.type || item.provider || 'gemini-cli'; const typeColorSet = TYPE_COLORS[displayType] || TYPE_COLORS.unknown; const typeColor: ThemeColors = resolvedTheme === 'dark' && typeColorSet.dark ? typeColorSet.dark : typeColorSet.light; const quotaStatus = quota?.status ?? 'idle'; const buckets = quota?.buckets ?? []; const quotaErrorMessage = getQuotaErrorMessage( quota?.errorStatus, quota?.error || t('common.unknown_error') ); const getTypeLabel = (type: string): string => { const key = `auth_files.filter_${type}`; const translated = t(key); if (translated !== key) return translated; if (type.toLowerCase() === 'iflow') return 'iFlow'; return type.charAt(0).toUpperCase() + type.slice(1); }; return (