FODASSE QUE BORRAÇO

This commit is contained in:
2025-10-26 00:25:13 +01:00
parent ede5003530
commit 76586c0df2
5 changed files with 28 additions and 15 deletions
+6 -5
View File
@@ -4,7 +4,7 @@
import { query } from '@/lib/db';
import { Event, EventRegistration } from '@/types/racing';
import { notFound } from 'next/navigation';
import { TrophyIcon, MapPinIcon, UsersIcon } from '@/components/ui/icons';
import { TrophyIcon, MapPinIcon, UsersIcon, ClockIcon, CalendarIcon } from '@/components/ui/icons';
import EventRegistrationForm from '@/components/events/EventRegistrationForm';
async function getEvent(eventId: number): Promise<Event | null> {
@@ -51,8 +51,9 @@ export default async function EventDetailPage({
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const eventId = parseInt(id);
const { event_id } = await params;
const eventId = parseInt(event_id, 10);
const event: any = await getEvent(eventId);
if (!event) {
@@ -87,8 +88,8 @@ export default async function EventDetailPage({
{/* Event Info Cards */}
<div className="grid grid-cols-1 md:grid-cols-4 gap-4 mt-12">
<InfoCard label="TRACK" value={event.event_track} icon={<MapPinIcon className="w-6 h-6" />} />
<InfoCard label="DATE" value={formatDate(event.event_date)} icon="📅" />
<InfoCard label="DURATION" value={`${event.event_duration || 'TBD'} min`} icon="⏱️" />
<InfoCard label="DATE" value={formatDate(event.event_date)} icon={<CalendarIcon className="w-6 h-6"/>} />
<InfoCard label="DURATION" value={`${event.event_duration || 'TBD'} min`} icon={<ClockIcon className="w-6 h-6" />} />
<InfoCard
label="PARTICIPANTS"
value={`${event.registrations_count}/${event.max_participants}`}