'use client' import { Switch } from '@langgenius/dify-ui/switch' import * as React from 'react' import { useTranslation } from 'react-i18next' export enum PlanRange { monthly = 'monthly', yearly = 'yearly', } type PlanRangeSwitcherProps = { value: PlanRange onChange: (value: PlanRange) => void } function PlanRangeSwitcher({ value, onChange }: PlanRangeSwitcherProps) { const { t } = useTranslation() return (
$['plansCommon.yearlyBilling'], { ns: 'billing' })} size="lg" checked={value === PlanRange.yearly} onCheckedChange={(v) => { onChange(v ? PlanRange.yearly : PlanRange.monthly) }} /> {t(($) => $['plansCommon.annualBilling'], { ns: 'billing', percent: 17 })}
) } export default React.memo(PlanRangeSwitcher)