import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import { DocumentProcessingPriority, Plan, } from '../type' import { useProviderContext } from '@/context/provider-context' import { ZapFast, ZapNarrow, } from '@/app/components/base/icons/src/vender/solid/general' import TooltipPlus from '@/app/components/base/tooltip-plus' const PriorityLabel = () => { const { t } = useTranslation() const { plan } = useProviderContext() const priority = useMemo(() => { if (plan.type === Plan.sandbox) return DocumentProcessingPriority.standard if (plan.type === Plan.professional) return DocumentProcessingPriority.priority if (plan.type === Plan.team || plan.type === Plan.enterprise) return DocumentProcessingPriority.topPriority }, [plan]) return (
{`${t('billing.plansCommon.documentProcessingPriority')}: ${t(`billing.plansCommon.priority.${priority}`)}`}
{ priority !== DocumentProcessingPriority.topPriority && (
{t('billing.plansCommon.documentProcessingPriorityTip')}
) } }> { plan.type === Plan.professional && ( ) } { (plan.type === Plan.team || plan.type === Plan.enterprise) && ( ) } {t(`billing.plansCommon.priority.${priority}`)}
) } export default PriorityLabel