'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; isDark: boolean; locale: Locale; } export default function MainTabs({ activeTab, onTabChange, showSubscribeTab, isDark, locale }: MainTabsProps) { if (!showSubscribeTab) return null; const tabs: { key: 'topup' | 'subscribe'; label: string }[] = [ { key: 'topup', label: pickLocaleText(locale, '按量付费', 'Pay-as-you-go') }, { key: 'subscribe', label: pickLocaleText(locale, '包月套餐', 'Subscription') }, ]; return (
{tabs.map((tab) => { const isActive = activeTab === tab.key; return ( ); })}
); }