"use client"; import { getCanvasData } from "@/app/actions/fetchers"; import { twitterCardUtil } from "@/components/canvas/custom_nodes/twittercard"; import { textCardUtil } from "@/components/canvas/custom_nodes/textcard"; import { memo, useEffect, useState } from "react"; import { Box, TldrawImage } from "tldraw"; const ImageComponent = memo(({ id }: { id: string }) => { const [snapshot, setSnapshot] = useState(); useEffect(() => { (async () => { setSnapshot(await getCanvasData(id)); })(); }, []); if (snapshot && snapshot.bounds) { const pageBounds = new Box( snapshot.bounds.x, snapshot.bounds.y, snapshot.bounds.w, snapshot.bounds.h, ); return ( ); } return (
Draw things. They will appear here.
); }); export default ImageComponent;