import { RiAedFill } from '@remixicon/react' import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import Tooltip from '@/app/components/base/tooltip' import { useProviderContext } from '@/context/provider-context' import { cn } from '@/utils/classnames' import { DocumentProcessingPriority, Plan, } from '../type' type PriorityLabelProps = { className?: string } const PriorityLabel = ({ className }: PriorityLabelProps) => { 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 return DocumentProcessingPriority.standard }, [plan]) return (
{t('plansCommon.documentProcessingPriority', { ns: 'billing' })} : {' '} {t(`plansCommon.priority.${priority}`, { ns: 'billing' })}
{ priority !== DocumentProcessingPriority.topPriority && (
{t('plansCommon.documentProcessingPriorityTip', { ns: 'billing' })}
) } )} >
{ (plan.type === Plan.professional || plan.type === Plan.team || plan.type === Plan.enterprise) && ( ) } {t(`plansCommon.priority.${priority}`, { ns: 'billing' })}
) } export default PriorityLabel