feat: dynamically import panel components to improve performance

This commit is contained in:
twwu 2025-08-06 11:40:30 +08:00
parent 6954926df9
commit 8717a789b3
1 changed files with 17 additions and 5 deletions

View File

@ -5,11 +5,23 @@ import {
import type { PanelProps } from '@/app/components/workflow/panel'
import Panel from '@/app/components/workflow/panel'
import { useStore } from '@/app/components/workflow/store'
import Record from '@/app/components/workflow/panel/record'
import TestRunPanel from './test-run'
import InputFieldPanel from './input-field'
import PreviewPanel from './input-field/preview'
import InputFieldEditorPanel from './input-field/editor'
import dynamic from 'next/dynamic'
const Record = dynamic(() => import('@/app/components/workflow/panel/record'), {
ssr: false,
})
const TestRunPanel = dynamic(() => import('@/app/components/rag-pipeline/components/panel/test-run'), {
ssr: false,
})
const InputFieldPanel = dynamic(() => import('./input-field'), {
ssr: false,
})
const InputFieldEditorPanel = dynamic(() => import('./input-field/editor'), {
ssr: false,
})
const PreviewPanel = dynamic(() => import('./input-field/preview'), {
ssr: false,
})
const RagPipelinePanelOnRight = () => {
const historyWorkflowData = useStore(s => s.historyWorkflowData)