From dc7a44551b18612b9aecb14be9305899833d4b91 Mon Sep 17 00:00:00 2001 From: Adwit Mukherji <66975870+4dw1tz@users.noreply.github.com> Date: Sat, 26 Oct 2024 17:08:31 +0100 Subject: [PATCH] commit for Ayush --- app/events/[...eventId]/page.tsx | 49 ++++++++++++++++++++++++++++++++ app/events/page.tsx | 26 ++++++++++------- 2 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 app/events/[...eventId]/page.tsx diff --git a/app/events/[...eventId]/page.tsx b/app/events/[...eventId]/page.tsx new file mode 100644 index 0000000..c44afbb --- /dev/null +++ b/app/events/[...eventId]/page.tsx @@ -0,0 +1,49 @@ +'use client'; +import React from 'react'; +import { useSearchParams } from 'next/navigation'; +import Header from '../../../components/custom/header'; +import Footer from '../../../components/custom/footer'; +import EventDescription from '../../../components/custom/EventDescription'; + +// Dummy function to simulate a GET request +const fetchEventDetails = (eventID: number) => { + alert(`Fetching details for event ID: ${eventID}`); + // Simulated JSON response for the event + return { + EventID: eventID, + name: 'Example Event Name', + date: '2023-12-01', + location: 'Example Location', + ticketPrice: 100, + description: 'Detailed description of the event.', + capacity: 300, + ticketsSold: 150, + imageUrl: [ + 'https://via.placeholder.com/150', + 'https://via.placeholder.com/150', + ], + host: 'Example Host', + tickets: [1, 2, 3, 4], + }; +}; + +const ListingPage: React.FC = () => { + const searchParams = useSearchParams(); + const eventID = searchParams.get('eventID'); + + // Simulate fetching data from backend + if (eventID) { + const eventDetails = fetchEventDetails(Number(eventID)); + console.log('Event Details:', eventDetails); + } + + return ( + <> +
+ +