fix: FINNALY FIXED AND COMPILABLE

This commit is contained in:
2026-06-24 11:37:56 +01:00
parent e9555c9f74
commit 426c1c50a0
13 changed files with 56 additions and 62 deletions
+4 -4
View File
@@ -2,13 +2,13 @@
// Events listing page
import { query } from '@/lib/db';
import { Event } from '@/types/racing';
import { EventWithRegistrations } from '@/types/racing';
import Link from 'next/link';
import Image from "next/image";
import { TrophyIcon, UsersIcon, MapPinIcon, ClockIcon, CalendarIcon } from '@/components/ui/icons';
export const dynamic = "force-dynamic";
async function getEvents(): Promise<Event[]> {
async function getEvents(): Promise<EventWithRegistrations[]> {
const sql = `
SELECT
e.*,
@@ -21,7 +21,7 @@ async function getEvents(): Promise<Event[]> {
`;
const rows = await query(sql);
return rows as Event[];
return rows as EventWithRegistrations[];
}
function formatDate(date: Date): string {
@@ -67,7 +67,7 @@ export default async function EventsPage() {
<p className="text-white/20 text-sm mt-2">Check back soon for new racing events</p>
</div>
) : (
events.map((event: unknown) => {
events.map((event) => {
const isOpen = event.event_status === 'OPEN';
const isFull = event.registrations_count >= event.max_participants;
const deadlinePassed = event.registration_deadline && new Date(event.registration_deadline) < new Date();