'use client'; import clsx from 'clsx'; import type React from 'react'; import { useState } from 'react'; import { Button, Disclosure, DisclosurePanel } from 'react-aria-components'; /** * Display an interactive OpenAPI disclosure. */ export function OpenAPIDisclosure(props: { icon: React.ReactNode; header: React.ReactNode; children: React.ReactNode; label: string | ((isExpanded: boolean) => string); className?: string; }): React.JSX.Element { const { icon, header, label, children, className } = props; const [isExpanded, setIsExpanded] = useState(false); return ( {isExpanded ? children : null} ); }