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.7 KB
Raw Blame
'use client'

import type { ReactNode } from 'react'
import { useTranslation } from 'react-i18next'
import { CommunityEditionTip } from '../community-edition-tip'

type AgentOrchestrateHeaderProps = {
  headingId: string
  trailingAction?: ReactNode
  isBuildDraftActive?: boolean
}

export function AgentOrchestrateHeader({
  headingId,
  trailingAction,
  isBuildDraftActive = false,
}: AgentOrchestrateHeaderProps) {
  const { t } = useTranslation(['agentV2'])
  const communityEditionIsolationTip = t(
    ($) => $['agentDetail.configure.communityEditionIsolationTip'],
  )

  return (
    <div className="shrink-0 px-4 py-3">
      <div className="flex h-6 min-w-0 items-center justify-between gap-2">
        <div className="flex min-w-0 items-center gap-2">
          <h2 id={headingId} className="truncate title-xl-semi-bold text-text-primary">
            {t(($) => $['agentDetail.configure.title'])}
          </h2>
          <CommunityEditionTip tip={communityEditionIsolationTip} className="max-w-[320px]" />
          {isBuildDraftActive && (
            <span className="flex min-w-4.5 shrink-0 items-center justify-center rounded-[5px] border border-text-accent-secondary bg-components-badge-bg-dimm px-1.25 py-0.75 system-2xs-medium-uppercase text-text-accent-secondary">
              {t(($) => $['agentDetail.configure.buildDraft.modeBadge'])}
            </span>
          )}
        </div>
        {trailingAction != null && <div className="shrink-0">{trailingAction}</div>}
      </div>
      {isBuildDraftActive && (
        <p className="mt-1 w-full system-xs-regular text-text-tertiary">
          {t(($) => $['agentDetail.configure.buildDraft.modeDescription'])}
        </p>
      )}
    </div>
  )
}