'use client'; import React from 'react'; import type { Locale } from '@/lib/locale'; import { pickLocaleText } from '@/lib/locale'; interface MainTabsProps { activeTab: 'topup' | 'subscribe'; onTabChange: (tab: 'topup' | 'subscribe') => void; showSubscribeTab: boolean; showTopUpTab?: boolean; isDark: boolean; locale: Locale; } export default function MainTabs({ activeTab, onTabChange, showSubscribeTab, showTopUpTab = true, isDark, locale, }: MainTabsProps) { if (!showSubscribeTab) return null; const tabs: { key: 'topup' | 'subscribe'; label: string }[] = []; if (showTopUpTab) { tabs.push({ key: 'topup', label: pickLocaleText(locale, '余额充值', 'Top Up') }); } tabs.push({ key: 'subscribe', label: pickLocaleText(locale, '套餐订阅', 'Subscription') }); // 只有一个 tab 时不显示切换器 if (tabs.length <= 1) return null; return (