初始化模版工程
This commit is contained in:
23
components/html-editor/index.tsx
Normal file
23
components/html-editor/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { TaskArtifact } from '../types';
|
||||
import { TaskHtmlDoc } from './mode/html-doc';
|
||||
import { TaskHtmlWeb } from './mode/html-web';
|
||||
import type { ArtifactEditState } from './types';
|
||||
|
||||
export const TaskArtifactHtml: React.FC<{
|
||||
taskId: string;
|
||||
editable?: boolean;
|
||||
taskArtifact: TaskArtifact;
|
||||
type: 'document' | 'web';
|
||||
onStateChange?: (state: ArtifactEditState) => void;
|
||||
}> = (props) => {
|
||||
const { taskId, editable, taskArtifact, type, onStateChange } = props;
|
||||
const Component = type === 'document' ? TaskHtmlDoc : TaskHtmlWeb;
|
||||
return (
|
||||
<Component
|
||||
taskId={taskId}
|
||||
taskArtifact={taskArtifact}
|
||||
editable={editable}
|
||||
onStateChange={onStateChange}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user