feat: refactor by splitting up app and doing proper state

This commit is contained in:
Brooklyn Nicholson 2026-04-14 22:30:18 -05:00
parent 4cbf54fb33
commit 99d859ce4a
27 changed files with 4087 additions and 2939 deletions

View file

@ -0,0 +1,24 @@
import { createContext, type ReactNode, useContext } from 'react'
import type { GatewayServices } from './interfaces.js'
const GatewayContext = createContext<GatewayServices | null>(null)
export interface GatewayProviderProps {
children: ReactNode
value: GatewayServices
}
export function GatewayProvider({ children, value }: GatewayProviderProps) {
return <GatewayContext.Provider value={value}>{children}</GatewayContext.Provider>
}
export function useGateway() {
const value = useContext(GatewayContext)
if (!value) {
throw new Error('GatewayContext missing')
}
return value
}