'use client'; // Overview.tsx — 概览(套餐横幅 + 用量指标 + 近 7 日柱状图 + 快速操作)。承袭 UCOverview。 import React from 'react'; import { Icon } from './icons'; import { card } from './shared'; import type { TFn, Lang } from '../lib/i18n'; import type { Me } from '../lib/api/types'; export default function Overview({ t, lang, me, mobile, goSub, goRedeem, }: { t: TFn; lang: Lang; me: Me; mobile: boolean; goSub: () => void; goRedeem: () => void; }) { const free = me.plan === 'free'; const vals = me.weeklyGB; const max = Math.max(...vals, 0.1); const labels = lang === 'zh' ? ['一', '二', '三', '四', '五', '六', '日'] : ['M', 'T', 'W', 'T', 'F', 'S', 'S']; const stats: [string, string, string, string][] = [ ['clock', t('quotaToday'), free ? String(me.quotaTodayMin ?? 0) : '∞', free ? 'min' : ''], ['arrow-down', t('dataToday'), me.dataTodayGB.toFixed(1), 'GB'], ['smartphone', t('devices'), `${me.devicesUsed} / ${me.devicesMax}`, ''], ]; return (