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.

950 B
Raw Blame
import { useTranslation } from 'react-i18next'

type CreditsFallbackAlertProps = {
  hasCredentials: boolean
}

export default function CreditsFallbackAlert({ hasCredentials }: CreditsFallbackAlertProps) {
  const { t } = useTranslation(['modelProvider'])

  const titleKey = hasCredentials
    ? 'modelProvider.card.apiKeyUnavailableFallback'
    : 'modelProvider.card.noApiKeysFallback'

  return (
    <div className="mx-2 mt-0.5 mb-1 rounded-lg bg-background-section-burn p-3">
      <div className="flex flex-col gap-1">
        <div className="system-sm-medium text-text-primary">
          {t(($) => $[titleKey], { ns: 'modelProvider' })}
        </div>
        {hasCredentials && (
          <div className="system-xs-regular text-text-tertiary">
            {t(($) => $['modelProvider.card.apiKeyUnavailableFallbackDescription'], {
              ns: 'modelProvider',
            })}
          </div>
        )}
      </div>
    </div>
  )
}