'use client'; import clsx from 'classnames'; 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; defaultExpanded?: boolean; }): React.JSX.Element { const { icon, header, label, children, className, defaultExpanded = false } = props; const [isExpanded, setIsExpanded] = useState(defaultExpanded); return ( {isExpanded ? ( {children} ) : null} ); }