import * as Tabs from '@radix-ui/react-tabs'; import { memo } from 'react'; import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; import { ErrorBoundary } from '~/components/ErrorBoundary'; import type { PageMap } from '~/lib/stores/pages'; import type { PageHistory, Section } from '~/types/actions'; import type { DocumentProperties } from '~/types/editor'; import { logger, renderLogger } from '~/utils/logger'; import { EditorStudio, type OnChangeCallback, type OnLoadCallback, type OnReadyCallback, type OnSaveCallback, } from '../editor/Editor'; import PageTree from './PageTree'; interface EditorPanelProps { documents?: Record; currentPage?: string; currentSection?: Section; pages?: PageMap; unsavedPages?: Set; pageHistory?: Record; isStreaming?: boolean; onEditorChange?: OnChangeCallback; onPageSave?: OnSaveCallback; onPageSelect?: (pageName: string) => void; onPageReset?: () => void; onLoad?: OnLoadCallback; onReady?: OnReadyCallback; } const editorSettings: any = { tabSize: 2 }; export const EditorPanel = memo( ({ documents, pages, unsavedPages, currentPage, currentSection, isStreaming, onEditorChange, onPageSave, onPageSelect, onPageReset, onLoad, onReady, }: EditorPanelProps) => { renderLogger.trace('EditorPanel'); return (
{ logger.error('Editor 组件发生错误', { error }); }} >
); }, );