import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { cn } from '@workspace/airo-ui/lib/utils'; import { useTranslations } from 'next-intl'; import React from 'react'; export type TabValueType = 'year' | 'month'; interface PlanTabProps { tabValue: TabValueType; setTabValue: (val: TabValueType) => void; discount: number; className?: string; } const PlanTabs: React.FC = (props) => { const t = useTranslations('components.offerDialog'); const { tabValue, className } = props; const TAB_LIST: { label: string; value: TabValueType }[] = [ { label: t('yearlyPlan'), value: 'year', }, { label: t('monthlyPlan'), value: 'month', }, ]; return ( props.setTabValue(value as 'year' | 'month')} > {tabValue === 'year' ? ( -{props.discount}%{/* 小三角箭头 */} ) : null} {TAB_LIST.map((val, key) => ( {val.label} ))} ); }; export default PlanTabs;