We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f5ca20 commit 4789ab0Copy full SHA for 4789ab0
1 file changed
client/src/pages/events/[id].tsx
@@ -0,0 +1,31 @@
1
+import { useRouter } from "next/router";
2
+
3
+import { useEvent } from "@/hooks/event";
4
5
+import DockLayout from "../layouts/docklayout";
6
7
+export default function EventDetailsPage() {
8
+ // useRouter allows access to URL parameters
9
+ const router = useRouter();
10
+ const id = Number(router.query.id);
11
12
+ const { data: event, isLoading } = useEvent(id);
13
+ if (isLoading) {
14
+ return <p>Loading event...</p>;
15
+ }
16
17
+ if (!event) {
18
+ return <p>Event not found</p>;
19
20
21
+ return (
22
+ <>
23
+ <DockLayout>
24
+ <div>
25
+ <h1>{event.event_name}</h1>
26
+ <p>{event.event_description}</p>
27
+ </div>
28
+ </DockLayout>
29
+ </>
30
+ );
31
+}
0 commit comments