'use client'; import { createContext, useContext } from 'react'; import Config from '@/types/config'; const ConfigContext = createContext(null); // Context Provider export function ConfigProvider({ children, initialConfig }: { children: React.ReactNode, initialConfig: Config|null }) { return ( {children} ); } // Context 사용을 위한 커스텀 훅 export function useConfigContext(): Config { const context = useContext(ConfigContext); if (context === null) { throw new Error('useConfigContext는 ConfigProvider 내부에서만 사용 가능합니다.'); } return context; }