mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-03 06:00:09 +00:00
15 lines
640 B
TypeScript
15 lines
640 B
TypeScript
import { createTLStore, defaultShapeUtils, loadSnapshot } from "tldraw";
|
|
import { getCanvasData } from "../app/actions/fetchers";
|
|
// import { twitterCardUtil } from "../components/canvas/custom_nodes/twitterCard";
|
|
import { twitterCardUtil } from "@/components/canvas/custom_nodes/twittercard";
|
|
import { textCardUtil } from "@/components/canvas/custom_nodes/textcard";
|
|
|
|
export async function loadRemoteSnapshot(id: string) {
|
|
const snapshot = await getCanvasData(id);
|
|
|
|
const newStore = createTLStore({
|
|
shapeUtils: [...defaultShapeUtils, twitterCardUtil, textCardUtil],
|
|
});
|
|
loadSnapshot(newStore, snapshot.snapshot);
|
|
return newStore;
|
|
}
|