Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.1 KB
Raw Blame
import { Alert, AlertActions, AlertDescription, AlertTitle } from '@langgenius/dify-ui/alert'
import { useTranslation } from 'react-i18next'
import UpgradeBtn from '@/app/components/billing/upgrade-btn'

type VectorSpaceAdmissionAlertProps = {
  showUpgrade: boolean
  estimatedMb: number
  planLimitMb: number
}

const VectorSpaceAdmissionAlert = ({
  showUpgrade,
  estimatedMb,
  planLimitMb,
}: VectorSpaceAdmissionAlertProps) => {
  const { t } = useTranslation(['datasetDocuments'])

  return (
    <Alert type="error">
      <AlertTitle>
        {t(($) => $['embedding.vectorSpaceEstimateExceeded.title'], {
          ns: 'datasetDocuments',
        })}
      </AlertTitle>
      <AlertDescription>
        {t(($) => $['embedding.vectorSpaceEstimateExceeded.description'], {
          ns: 'datasetDocuments',
          estimated: estimatedMb,
          limit: planLimitMb,
        })}
      </AlertDescription>
      {showUpgrade && (
        <AlertActions>
          <UpgradeBtn size="s" loc="knowledge-vector-space-admission" />
        </AlertActions>
      )}
    </Alert>
  )
}

export default VectorSpaceAdmissionAlert