Initial commit

This commit is contained in:
KabundiNjuki
2026-10-05 16:40:36 +03:00
commit ff743a1397
108 changed files with 15390 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
'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<EventContextValue>({ event: EMPTY_EVENT, registrationEnabled: false })
export function EventProvider({
event,
registrationEnabled,
children,
}: EventContextValue & { children: React.ReactNode }) {
return <EventContext.Provider value={{ event, registrationEnabled }}>{children}</EventContext.Provider>
}
// 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)
}