diff --git a/app/PreviewShape/PreviewShape.tsx b/app/PreviewShape/PreviewShape.tsx index b537088..c9e5b16 100644 --- a/app/PreviewShape/PreviewShape.tsx +++ b/app/PreviewShape/PreviewShape.tsx @@ -12,6 +12,7 @@ import { Vec2d, useValue, } from '@tldraw/tldraw' +import { UrlLinkButton } from '../components/UrlLinkButton' export type PreviewShape = TLBaseShape< 'preview', @@ -127,42 +128,7 @@ export class PreviewShapeUtil extends BaseBoxShapeUtil { )} - {htmlToUse && ( - - )} + {htmlToUse && } {htmlToUse && (
{ + if (navigator && navigator.clipboard) { + navigator.clipboard.writeText(`${window.location.origin}/link/${shape.id.split(':')[1]}`) + toast.addToast({ + icon: 'code', + title: 'Copied url to clipboard', + }) + } + }} + onPointerDown={stopEventPropagation} + title="Copy url to clipboard" + > + + + ) +}