index.tsx 774 B

1234567891011121314151617181920
  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. <DataSourceNotion workspaces={notionWorkspaces} />
  14. <DataSourceWebsite provider={DataSourceProvider.jinaReader} />
  15. <DataSourceWebsite provider={DataSourceProvider.fireCrawl} />
  16. </div>
  17. )
  18. }