'use client' import React, { useMemo, useState } from 'react' import { useTranslation } from 'react-i18next' import FilePreview from '../file-preview' import FileUploader from '../file-uploader' import NotionPagePreview from '../notion-page-preview' import EmptyDatasetCreationModal from '../empty-dataset-creation-modal' import Website from '../website' import WebsitePreview from '../website/preview' import s from './index.module.css' import cn from '@/utils/classnames' import type { CrawlOptions, CrawlResultItem, FileItem } from '@/models/datasets' import type { DataSourceProvider, NotionPage } from '@/models/common' import { DataSourceType } from '@/models/datasets' import Button from '@/app/components/base/button' import { NotionPageSelector } from '@/app/components/base/notion-page-selector' import { useDatasetDetailContext } from '@/context/dataset-detail' import { useProviderContext } from '@/context/provider-context' import VectorSpaceFull from '@/app/components/billing/vector-space-full' type IStepOneProps = { datasetId?: string dataSourceType?: DataSourceType dataSourceTypeDisable: Boolean hasConnection: boolean onSetting: () => void files: FileItem[] updateFileList: (files: FileItem[]) => void updateFile: (fileItem: FileItem, progress: number, list: FileItem[]) => void notionPages?: NotionPage[] updateNotionPages: (value: NotionPage[]) => void onStepChange: () => void changeType: (type: DataSourceType) => void websitePages?: CrawlResultItem[] updateWebsitePages: (value: CrawlResultItem[]) => void onWebsiteCrawlProviderChange: (provider: DataSourceProvider) => void onWebsiteCrawlJobIdChange: (jobId: string) => void crawlOptions: CrawlOptions onCrawlOptionsChange: (payload: CrawlOptions) => void } type NotionConnectorProps = { onSetting: () => void } export const NotionConnector = ({ onSetting }: NotionConnectorProps) => { const { t } = useTranslation() return (