import { useLayoutEffect } from "file:///Users/dmail/Documents/dev/core/node_modules/react/index.js?cjs_as_js_module";
import appStyleSheet from "file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-react/src/app/app.css?as_css_module" ;
import { Counter } from "file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-react/src/app/counter.jsx";
import { jsx as _jsx, jsxs as _jsxs } from "file:///Users/dmail/Documents/dev/core/node_modules/react/jsx-runtime.js?cjs_as_js_module";
const reactLogoUrl = new URL("file:///Users/dmail/Documents/dev/core/packages/related/cli/template-web-react/src/react_logo.svg", import.meta.url);
export const App = () => {
  useLayoutEffect(() => {
    document.adoptedStyleSheets = [...document.adoptedStyleSheets, appStyleSheet];
    return () => {
      document.adoptedStyleSheets = document.adoptedStyleSheets.filter(s => s !== appStyleSheet);
    };
  }, []);
  return /*#__PURE__*/_jsx("div", {
    className: "app",
    children: /*#__PURE__*/_jsxs("header", {
      className: "app_header",
      children: [/*#__PURE__*/_jsx("img", {
        src: reactLogoUrl,
        className: "app_logo",
        alt: "logo"
      }), /*#__PURE__*/_jsx("p", {
        children: "Hello jsenv + React!"
      }), /*#__PURE__*/_jsx("p", {
        children: /*#__PURE__*/_jsx(Counter, {})
      }), /*#__PURE__*/_jsxs("p", {
        children: ["Edit", " ", /*#__PURE__*/_jsx("a", {
          className: "app_link",
          onClick: e => {
            e.preventDefault();
            window.fetch("/.internal/open_file/app/app.jsx");
          },
          children: "app.jsx"
        }), " ", "and save to test HMR updates."]
      }), /*#__PURE__*/_jsx("p", {
        children: /*#__PURE__*/_jsx("a", {
          className: "app_link",
          href: "https://github.com/jsenv/core",
          target: "_blank",
          rel: "noopener noreferrer",
          children: "Jsenv documentation"
        })
      })]
    })
  });
};