From a46f583437e9b66ebec6fa22e27567a71b17b497 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 21 Jul 2024 16:13:58 +0900
Subject: react router

---
 frontend/src/main.tsx | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 frontend/src/main.tsx

(limited to 'frontend/src/main.tsx')

diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
new file mode 100644
index 0000000..0df5185
--- /dev/null
+++ b/frontend/src/main.tsx
@@ -0,0 +1,35 @@
+import React from 'react'
+import ReactDOM from 'react-dom/client'
+import {
+  createBrowserRouter,
+  RouterProvider,
+} from 'react-router-dom';
+import Home from './routes/Home.tsx';
+import GolfEntry from './routes/golf/GolfEntry.tsx';
+import GolfPlay from './routes/golf/GolfPlay.tsx';
+import GolfWatch from './routes/golf/GolfWatch.tsx';
+
+const router = createBrowserRouter([
+  {
+    path: "/",
+    element: (<Home />),
+  },
+  {
+    path: "/golf/entry/",
+    element: (<GolfEntry />),
+  },
+  {
+    path: "/golf/:gameId/play/:playerId/",
+    element: (<GolfPlay />),
+  },
+  {
+    path: "/golf/:gameId/watch/",
+    element: (<GolfWatch />),
+  },
+]);
+
+ReactDOM.createRoot(document.getElementById('root')!).render(
+  <React.StrictMode>
+    <RouterProvider router={router} />
+  </React.StrictMode>,
+)
-- 
cgit v1.3.1

