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.

939 B
Raw Blame
import type { ReactNode } from 'react'
import { Button } from '@langgenius/dify-ui/button'
import { RiAddLine } from '@remixicon/react'
import { memo } from 'react'
import { useTranslation } from 'react-i18next'

type PluginAuthInDataSourceNodeProps = {
  children?: ReactNode
  isAuthorized?: boolean
  onJumpToDataSourcePage: () => void
}
const PluginAuthInDataSourceNode = ({
  children,
  isAuthorized,
  onJumpToDataSourcePage,
}: PluginAuthInDataSourceNodeProps) => {
  const { t } = useTranslation(['common'])
  return (
    <>
      {!isAuthorized && (
        <div className="px-4 pb-2">
          <Button className="w-full" variant="primary" onClick={onJumpToDataSourcePage}>
            <RiAddLine className="size-4" />
            {t(($) => $['integrations.connect'], { ns: 'common' })}
          </Button>
        </div>
      )}
      {isAuthorized && children}
    </>
  )
}

export default memo(PluginAuthInDataSourceNode)