'use client' import type { FC } from 'react' import React from 'react' import ModelConfig from './model-config' import DataConfig from './data-config' import PluginConfig from './plugins-config' import type { ProviderEnum } from '@/app/components/header/account-setting/model-page/declarations' import type { DataSet } from '@/models/datasets' export type IConfigProps = { className?: string readonly?: boolean modelId: string providerName: ProviderEnum onModelChange?: (modelId: string, providerName: ProviderEnum) => void plugins: Record onPluginChange?: (key: string, value: boolean) => void dataSets: DataSet[] onDataSetsChange?: (contexts: DataSet[]) => void } const Config: FC = ({ className, readonly, modelId, providerName, onModelChange, plugins, onPluginChange, dataSets, onDataSetsChange, }) => { return (
{(!readonly || (readonly && dataSets.length > 0)) && ( )}
) } export default React.memo(Config)