import { cn } from '@langgenius/dify-ui/cn' import { Tooltip, TooltipContent, TooltipTrigger } from '@langgenius/dify-ui/tooltip' import { RiAedFill } from '@remixicon/react' import { useQuery } from '@tanstack/react-query' import { useAtomValue } from 'jotai' import { useTranslation } from 'react-i18next' import { deploymentEditionAtom } from '@/features/system-features/state' import { consoleQuery } from '@/service/client' type PriorityLabelProps = { className?: string } const PriorityLabel = ({ className }: PriorityLabelProps) => { const { t } = useTranslation() const deploymentEdition = useAtomValue(deploymentEditionAtom) const { data: plan } = useQuery( consoleQuery.features.get.queryOptions({ enabled: deploymentEdition === 'CLOUD', select: (data) => data.billing.subscription.plan, }), ) if (deploymentEdition !== 'CLOUD' || plan === undefined) return null const priority = { sandbox: 'standard', professional: 'priority', team: 'top-priority' } as const const label = priority[plan] return ( } > {(plan === 'professional' || plan === 'team') && } {t(($) => $[`plansCommon.priority.${label}`], { ns: 'billing' })}
{t(($) => $['plansCommon.documentProcessingPriority'], { ns: 'billing' })}:{' '} {t(($) => $[`plansCommon.priority.${label}`], { ns: 'billing' })}
{label !== 'top-priority' && (
{t(($) => $['plansCommon.documentProcessingPriorityTip'], { ns: 'billing' })}
)}
) } export default PriorityLabel