/// <reference no-default-lib="true"/>
/// <reference lib="esnext"/>
/// <reference lib="dom"/>
/** @jsx h */
import { render, h } from "../preact/mod.tsx";
import { App } from "./App.tsx";

export const setup = () => {
  const app = document.createElement("div");
  const shadowRoot = app.attachShadow({ mode: "open" });
  document.body.append(app);
  render(<App delay={500} />, shadowRoot);
  
  return () => {
    render(null, shadowRoot);
    app.remove();
  };
};
