'use client' import type { FC } from 'react' import { Button } from '@langgenius/dify-ui/button' import * as React from 'react' import { useTranslation } from 'react-i18next' import { Icon3Dots } from '@/app/components/base/icons/src/vender/line/others' import { ENABLE_WEBSITE_FIRECRAWL, ENABLE_WEBSITE_JINAREADER, ENABLE_WEBSITE_WATERCRAWL, } from '@/config' import { DataSourceProvider } from '@/models/common' import s from './index.module.css' const I18N_PREFIX = 'stepOne.website' type Props = Readonly<{ onConfig: () => void provider: DataSourceProvider }> const NoData: FC = ({ onConfig, provider }) => { const { t } = useTranslation() const providerConfig: Record< DataSourceProvider, { emoji: React.ReactNode title: string description: string } | null > = { [DataSourceProvider.jinaReader]: ENABLE_WEBSITE_JINAREADER ? { emoji: , title: t(($) => $[`${I18N_PREFIX}.jinaReaderNotConfigured`], { ns: 'datasetCreation' }), description: t(($) => $[`${I18N_PREFIX}.jinaReaderNotConfiguredDescription`], { ns: 'datasetCreation', }), } : null, [DataSourceProvider.fireCrawl]: ENABLE_WEBSITE_FIRECRAWL ? { emoji: '🔥', title: t(($) => $[`${I18N_PREFIX}.fireCrawlNotConfigured`], { ns: 'datasetCreation' }), description: t(($) => $[`${I18N_PREFIX}.fireCrawlNotConfiguredDescription`], { ns: 'datasetCreation', }), } : null, [DataSourceProvider.waterCrawl]: ENABLE_WEBSITE_WATERCRAWL ? { emoji: '💧', title: t(($) => $[`${I18N_PREFIX}.waterCrawlNotConfigured`], { ns: 'datasetCreation' }), description: t(($) => $[`${I18N_PREFIX}.waterCrawlNotConfiguredDescription`], { ns: 'datasetCreation', }), } : null, } const currentProvider = providerConfig[provider] || providerConfig.jinareader if (!currentProvider) return null return ( <>
{currentProvider.emoji}
{currentProvider.title}
{currentProvider.description}
) } export default React.memo(NoData)