index.tsx 871 B

123456789101112131415161718192021
  1. import useSWR from 'swr'
  2. import { useTranslation } from 'react-i18next'
  3. import DataSourceNotion from './data-source-notion'
  4. import DataSourceWebsite from './data-source-website'
  5. import { fetchDataSource } from '@/service/common'
  6. import { DataSourceProvider } from '@/models/common'
  7. export default function DataSourcePage() {
  8. const { t } = useTranslation()
  9. const { data } = useSWR({ url: 'data-source/integrates' }, fetchDataSource)
  10. const notionWorkspaces = data?.data.filter(item => item.provider === 'notion') || []
  11. return (
  12. <div className='mb-8'>
  13. <div className='mb-2 text-sm font-medium text-gray-900'>{t('common.dataSource.add')}</div>
  14. <DataSourceNotion workspaces={notionWorkspaces} />
  15. <DataSourceWebsite provider={DataSourceProvider.jinaReader} />
  16. <DataSourceWebsite provider={DataSourceProvider.fireCrawl} />
  17. </div>
  18. )
  19. }