diff --git a/app/routes/_marketing.playground.tsx b/app/routes/_marketing.playground.tsx new file mode 100644 index 00000000..b17f68cb --- /dev/null +++ b/app/routes/_marketing.playground.tsx @@ -0,0 +1,322 @@ +import * as React from "react"; +import { type HeadersFunction } from "@remix-run/node"; +import { Await } from "@remix-run/react"; +import ManacoEditor from "@monaco-editor/react"; +import type * as wc from "@webcontainer/api"; + +export default function Playground() { + const state = useWebContainer(); + const [mounted, setMounted] = React.useState(false); + React.useEffect(() => { + setMounted(true); + }, []); + + const loadingState = ( +
+ {state?.status ? `${state.status}...` : "booting..."} +
+ ); + + if (!mounted || (!state?.containerPromise && !state?.container)) { + return loadingState; + } + + return ( + + {() => ( +
+
+
+