import { useRender } from "@atomico/hooks/use-render"; import { Props, c, css, useAsync, useEffect, useRef } from "atomico"; import { tokensCard, tokensCode, tokensColor } from "../site-tokens"; const preloadAtomico = async (children: any) => (await import("atomico")).h("host", { children }); const loadAsync = async ( sandbox: boolean, load: () => Promise ): Promise<{ props: any; default: any; }> => { if (sandbox) return undefined; return load(); }; function sitePreview({ load, sandbox }: Props) { const ref = useRef(); const module = useAsync(loadAsync, [sandbox, load]); useRender(() => { return sandbox ? (