()
| 23 | export const TocLandingContext = createContext<TocLandingContextT | null>(null) |
| 24 | |
| 25 | export const useTocLandingContext = (): TocLandingContextT => { |
| 26 | const context = useContext(TocLandingContext) |
| 27 | |
| 28 | if (!context) { |
| 29 | throw new Error('"useTocLandingContext" may only be used inside "TocLandingContext.Provider"') |
| 30 | } |
| 31 | |
| 32 | return context |
| 33 | } |
| 34 | |
| 35 | export const getTocLandingContextFromRequest = (req: any): TocLandingContextT => { |
| 36 | return { |