import { useState, useRef } from 'react' import Link from 'next/link' import OperationObject from './partials/operation-object' import Head from 'next/head' import HashiHead from '@hashicorp/react-head' import DocsSidenav from '@hashicorp/react-docs-sidenav' import Content from '@hashicorp/react-content' import { getPathsFromSchema, getPropsForPage } from './utils/routing-utils' import styles from './style.module.css' import useOnClickOutside from 'lib/hooks/use-on-click-outside' function OpenApiPage({ info, operationCategory, navData, productName, productSlug, currentPath, }) { const operationsRef = useRef(null) const [expandedOperations, setExpandedOperations] = useState([]) useOnClickOutside(operationsRef, () => setExpandedOperations([])) function setOperationState(slug, isExpanded) { const newStates = expandedOperations.filter((s) => s !== slug) if (isExpanded) newStates.push(slug) setExpandedOperations(newStates) } const pageTitle = operationCategory ? operationCategory.name : info.title return (
{info.title}
Select a service from the sidebar.
> ) } />