From 8b5b3dd00cc16c351670a25933f4b37a604abaf8 Mon Sep 17 00:00:00 2001
From: Steven Le Rouzic <steven.lerouzic@gmail.com>
Date: Sun, 11 May 2025 23:42:35 +0200
Subject: Initial commit

---
 client/src/App.svelte | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 client/src/App.svelte

(limited to 'client/src/App.svelte')

diff --git a/client/src/App.svelte b/client/src/App.svelte
new file mode 100644
index 0000000..488312f
--- /dev/null
+++ b/client/src/App.svelte
@@ -0,0 +1,33 @@
+<script lang="ts">
+  import page from "page";
+  import { onMount } from "svelte";
+  import type { Component, ComponentProps } from "svelte";
+  import Home from "./pages/Home.svelte";
+
+  let CurrentPage: Component<any> | null = $state(null);
+  let currentPageProps: any = $state({});
+
+  function bindComponent<T extends Component<any>>(
+    component: T,
+    props: ComponentProps<T>,
+  ) {
+    CurrentPage = component;
+    currentPageProps = props;
+  }
+
+  onMount(() => {
+    page("/", () => {
+      bindComponent(Home, {});
+    });
+
+    page.start();
+  });
+</script>
+
+<main>
+  {#if CurrentPage}
+    <CurrentPage {...currentPageProps}></CurrentPage>
+  {:else}
+    <p>No page bound</p>
+  {/if}
+</main>
-- 
cgit 

