Files
test1/components/html-editor/index.tsx
2026-03-20 07:33:46 +00:00

24 lines
704 B
TypeScript

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}
/>
);
};