1- // app/bus/[busNumber]/page.tsx
1+ import { notFound } from 'next/navigation' ;
2+ import clubData from '@/components/club/ClubData' ;
23
34
4- export default function Home ( ) {
5- return (
6- < div >
7- < p >
8- In this dynamic page, when you click any bus button, the UI/UX for all bus locations remains the same.
9- We use a dynamic page system so that clicking on, for example, the "Bus 1" button redirects here,
10- but the displayed content updates to show the respective bus's location.
11- </ p >
12- </ div >
13- ) ;
14- }
5+ export default async function ClubDetailPage ( { params } : { params : { slug : string } } ) {
6+ const { slug } = await Promise . resolve ( params ) ; // simulate async destructuring
157
16- // import { notFound } from 'next/navigation';
17-
18- // // Mock data for clubs (replace with actual data fetching logic)
19- // const clubsData = [
20- // {
21- // slug: 'coding',
22- // clubName: 'Coding Club',
23- // subheading: 'Innovate. Code. Build.',
24- // image: '/images/coding-club.jpg',
25- // description: 'Join us to learn and build amazing projects with the latest technologies.',
26- // socialMedia: {
27- // instagram: 'https://instagram.com/codingclub',
28- // linkedin: 'https://linkedin.com/company/codingclub',
29- // whatsapp: 'https://wa.me/1234567890',
30- // },
31- // },
32- // {
33- // slug: 'drama',
34- // clubName: 'Drama Club',
35- // subheading: 'Act. Perform. Inspire.',
36- // image: '/images/drama-club.jpg',
37- // description: 'Express yourself through the art of drama and theater.',
38- // socialMedia: {
39- // instagram: 'https://instagram.com/dramaclub',
40- // linkedin: 'https://linkedin.com/company/dramaclub',
41- // whatsapp: 'https://wa.me/1234567890',
42- // },
43- // },
44- // // Add more clubs as needed
45- // ];
46-
47- // export default function ClubDetailPage({ params }: { params: { slug: string } }) {
48- // const { slug } = params;
49-
50- // // Find the club data based on the slug
51- // const club = clubsData.find((club) => club.slug === slug);
52-
53- // // If club not found, return a 404 page
54- // if (!club) {
55- // notFound();
56- // }
57-
58- // return (
59- // <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-black text-white">
60- // {/* Heading */}
61- // <h1 className="text-4xl font-bold mb-2">{club.clubName}</h1>
62-
63- // {/* Subheading */}
64- // <h2 className="text-xl text-gray-400 mb-6">{club.subheading}</h2>
65-
66- // {/* Picture */}
67- // <img
68- // src={club.image}
69- // alt={club.clubName}
70- // className="w-full max-w-md rounded-lg mb-6"
71- // />
72-
73- // {/* Description */}
74- // <p className="text-lg text-center max-w-2xl mb-8">{club.description}</p>
75-
76- // {/* Social Media Icons */}
77- // <div className="flex space-x-4">
78- // <a href={club.socialMedia.instagram} target="_blank" rel="noopener noreferrer">
79- // <img src="/icons/instagram.svg" alt="Instagram" className="w-8 h-8" />
80- // </a>
81- // <a href={club.socialMedia.linkedin} target="_blank" rel="noopener noreferrer">
82- // <img src="/icons/linkedin.svg" alt="LinkedIn" className="w-8 h-8" />
83- // </a>
84- // <a href={club.socialMedia.whatsapp} target="_blank" rel="noopener noreferrer">
85- // <img src="/icons/whatsapp.svg" alt="WhatsApp" className="w-8 h-8" />
86- // </a>
87- // </div>
88- // </div>
89- // );
90- // }
8+ const club = clubData . find ( ( c ) => c . slug === slug ) ;
9+ if ( ! club ) notFound ( ) ;
10+ return < h1 > Club Details</ h1 > ;
11+ }
0 commit comments