'use client' import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import { RiBook2Line, RiBox3Line, RiFileEditLine, RiGroup3Line, RiGroupLine, RiSquareLine, } from '@remixicon/react' import { Plan, SelfHostedPlan } from '../type' import VectorSpaceInfo from '../usage-info/vector-space-info' import AppsInfo from '../usage-info/apps-info' import UpgradeBtn from '../upgrade-btn' import { useProviderContext } from '@/context/provider-context' import UsageInfo from '@/app/components/billing/usage-info' type Props = { loc: string } const PlanComp: FC = ({ loc, }) => { const { t } = useTranslation() const { plan } = useProviderContext() const { type, } = plan const { usage, total, } = plan return (
{plan.type === Plan.sandbox && ( )} {plan.type === Plan.professional && ( )} {plan.type === Plan.team && ( )} {(plan.type as any) === SelfHostedPlan.enterprise && ( )}
{t(`billing.plans.${type}.name`)}
{t('billing.currentPlan')}
{t(`billing.plans.${type}.for`)}
{(plan.type as any) !== SelfHostedPlan.enterprise && ( )}
{/* Plan detail */}
) } export default React.memo(PlanComp)