Core/demo/demo.tsx

38 lines
895 B
TypeScript
Raw Permalink Normal View History

import "../index";
2024-06-08 23:52:26 +02:00
import React from "react";
import {createRoot} from "react-dom/client";
import {DemoApp} from "./DemoApp";
import {createBrowserRouter} from "react-router-dom";
import {Kernel} from "../src/Application/Kernel";
import {NavTest} from "./NavTest";
2024-07-07 19:10:24 +02:00
import {Avocado} from "@phosphor-icons/react";
import {ApplicationError} from "../src/Application/ApplicationError";
// Router initialization.
const router = createBrowserRouter([
{
path: "/",
element: <DemoApp />,
children: [
{
path: "test",
element: <NavTest />,
}
],
errorElement: <ApplicationError />,
}
])
2024-06-08 23:52:26 +02:00
document.addEventListener("DOMContentLoaded", () => {
const demoApp = document.getElementById("demo-app");
const root = createRoot(demoApp);
root.render(<Kernel router={router} footer={
<footer>
2024-07-07 19:10:24 +02:00
<Avocado weight={"duotone"} size={32} />
<div>Kernel</div>
</footer>
} />);
2024-06-08 23:52:26 +02:00
});