dify/web/features/deployments/deploy-drawer/ui/status-badge.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

18 lines
917 B
TypeScript

'use client'
import type { EnvironmentMode } from '@dify/contracts/enterprise/types.gen'
import { EnvironmentMode as EnvironmentModeEnum } from '@dify/contracts/enterprise/types.gen'
import { cn } from '@langgenius/dify-ui/cn'
import { useTranslation } from 'react-i18next'
const baseBadge =
'inline-flex items-center gap-1 rounded-md border px-2 py-0.5 system-xs-medium whitespace-nowrap'
export function ModeBadge({ mode, className }: { mode: EnvironmentMode; className?: string }) {
const { t } = useTranslation('deployments')
const style =
mode === EnvironmentModeEnum.ENVIRONMENT_MODE_SHARED
? 'border-util-colors-green-green-200 bg-util-colors-green-green-50 text-util-colors-green-green-700'
: 'border-util-colors-blue-blue-200 bg-util-colors-blue-blue-50 text-util-colors-blue-blue-700'
return <span className={cn(baseBadge, style, className)}>{t(($) => $[`mode.${mode}`])}</span>
}