2023-06-01 23:19:36 +08:00
|
|
|
'use client'
|
2025-06-12 15:13:15 +08:00
|
|
|
import React from 'react'
|
|
|
|
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
|
|
|
|
import DocumentSettings from './document-settings'
|
|
|
|
import PipelineSettings from './pipeline-settings'
|
2023-06-01 23:19:36 +08:00
|
|
|
|
2025-06-12 15:13:15 +08:00
|
|
|
type SettingsProps = {
|
2023-06-06 10:52:02 +08:00
|
|
|
datasetId: string
|
|
|
|
documentId: string
|
2023-06-01 23:19:36 +08:00
|
|
|
}
|
|
|
|
|
2025-06-12 15:13:15 +08:00
|
|
|
const Settings = ({
|
|
|
|
datasetId,
|
|
|
|
documentId,
|
|
|
|
}: SettingsProps) => {
|
2025-06-12 15:57:07 +08:00
|
|
|
const runtimeMode = useDatasetDetailContextWithSelector(s => s.dataset?.runtime_mode)
|
|
|
|
const isGeneralDataset = runtimeMode === 'general'
|
2025-06-12 15:13:15 +08:00
|
|
|
|
2025-06-12 15:57:07 +08:00
|
|
|
if (isGeneralDataset) {
|
2025-06-12 15:13:15 +08:00
|
|
|
return (
|
|
|
|
<DocumentSettings
|
|
|
|
datasetId={datasetId}
|
|
|
|
documentId={documentId}
|
|
|
|
/>
|
|
|
|
)
|
2024-12-26 12:01:51 +08:00
|
|
|
}
|
2023-06-01 23:19:36 +08:00
|
|
|
|
|
|
|
return (
|
2025-06-12 15:13:15 +08:00
|
|
|
<PipelineSettings
|
|
|
|
datasetId={datasetId}
|
|
|
|
documentId={documentId}
|
|
|
|
/>
|
2023-06-01 23:19:36 +08:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2025-06-12 15:13:15 +08:00
|
|
|
export default Settings
|