diff --git a/.gitignore b/.gitignore index fd3dbb57..0af5bf6d 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +.idea diff --git a/app/PreviewShape/PreviewShape.tsx b/app/PreviewShape/PreviewShape.tsx index 453c5c43..abda128b 100644 --- a/app/PreviewShape/PreviewShape.tsx +++ b/app/PreviewShape/PreviewShape.tsx @@ -10,12 +10,14 @@ import { stopEventPropagation, DefaultSpinner, } from '@tldraw/tldraw' +import { CompletionMessageItem } from '../lib/getHtmlFromOpenAI' +import React from 'react' export type PreviewShape = TLBaseShape< 'preview', { html: string - source: string + history: CompletionMessageItem[], w: number h: number } @@ -26,7 +28,7 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil { getDefaultProps(): PreviewShape['props'] { return { html: '', - source: '', + history: [], w: (960 * 2) / 3, h: (540 * 2) / 3, } @@ -40,9 +42,10 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil { override component(shape: PreviewShape) { const isEditing = useIsEditing(shape.id) + const [reloadKey, setReloadKey] = React.useState(0) const toast = useToasts() return ( - + {shape.props.html ? (