'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import React, { createContext, useContext, useCallback } from 'react';
const DocsNavigationContext = /*#__PURE__*/ createContext(null);
export function DocsNavigationProvider({ children, onNavigateToPage, onNavigateToEndpoint, onSwitchTab, activeTab }) {
    const navigateToPage = useCallback((slug)=>{
        if (onNavigateToPage) {
            onNavigateToPage(slug);
        }
    }, [
        onNavigateToPage
    ]);
    const navigateToEndpoint = useCallback((endpointId)=>{
        if (onNavigateToEndpoint) {
            onNavigateToEndpoint(endpointId);
        }
    }, [
        onNavigateToEndpoint
    ]);
    const switchToTab = useCallback((tabId)=>{
        if (onSwitchTab) {
            onSwitchTab(tabId);
        }
    }, [
        onSwitchTab
    ]);
    return /*#__PURE__*/ _jsx(DocsNavigationContext.Provider, {
        value: {
            navigateToPage,
            navigateToEndpoint,
            switchToTab,
            isApiDocsView: !!onNavigateToPage,
            activeTab
        },
        children: children
    });
}
export function useDocsNavigation() {
    return useContext(DocsNavigationContext);
}
