'use client' import React, { createContext, useContext, useState } from 'react' type ExternalApiPanelContextType = { showExternalApiPanel: boolean setShowExternalApiPanel: (show: boolean) => void } const ExternalApiPanelContext = createContext(undefined) export const ExternalApiPanelProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => { const [showExternalApiPanel, setShowExternalApiPanel] = useState(false) return ( {children} ) } export const useExternalApiPanel = () => { const context = useContext(ExternalApiPanelContext) if (context === undefined) throw new Error('useExternalApiPanel must be used within an ExternalApiPanelProvider') return context }