| 1 | "use client"; |
| 2 | |
| 3 | import { createContext, type ReactNode } from "react"; |
| 4 | |
| 5 | import { type LayoutType } from "../../utils/parser"; |
| 6 | |
| 7 | type PresentationRenderContextValue = { |
| 8 | layoutType?: LayoutType; |
| 9 | isStatic: boolean; |
| 10 | }; |
| 11 | |
| 12 | const PresentationRenderContext = createContext<PresentationRenderContextValue>( |
| 13 | { |
| 14 | isStatic: false, |
| 15 | }, |
| 16 | ); |
| 17 | |
| 18 | export function PresentationRenderProvider({ |
| 19 | children, |
| 20 | layoutType, |
| 21 | isStatic, |
| 22 | }: PresentationRenderContextValue & { children: ReactNode }) { |
| 23 | return ( |
| 24 | <PresentationRenderContext.Provider value={{ layoutType, isStatic }}> |
| 25 | {children} |
| 26 | </PresentationRenderContext.Provider> |
| 27 | ); |
| 28 | } |
| 29 |