'use client' import { createContext, useContext } from 'react' import { EMPTY_EVENT, type PublicEvent } from '@/lib/event-types' interface EventContextValue { event: PublicEvent registrationEnabled: boolean } const EventContext = createContext({ event: EMPTY_EVENT, registrationEnabled: false }) export function EventProvider({ event, registrationEnabled, children, }: EventContextValue & { children: React.ReactNode }) { return {children} } // Client components read the current edition and its races from here. The root layout // fetches them once per page render. export function useEvent() { return useContext(EventContext) }