import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "@heroicons/react/24/solid"; import clsx from "clsx"; import { useState } from "react"; interface APICallProps { method: "GET" | "POST"; url: string; description: string; headers: { label: string; type: string; description: string; }[]; bodies: { label: string; type: string; description: string; required?: boolean; }[]; responses: { color: string; statusCode: string; description: string; example?: string; }[]; example?: string; } export function APILayout({ method, url, description, headers, bodies, responses, example }: APICallProps) { const [switchState, setSwitchState] = useState(true); function handleOnChange() { setSwitchState(!switchState); } return (
{switchState ? (
); } interface ParaProps { label: string; type: string; description: string; required?: boolean; } function Parameter({ label, type, description, required }: ParaProps) { return ( <>
{label} {required &&

*

}
{type}
{description}
); } interface RespProps { color: string; statusCode: string; description: string; example?: string; } function Response({ color, statusCode, description, example }: RespProps) { const [toggleExample, setSwitchState] = useState(false); function handleOnChange() { setSwitchState(!toggleExample); } return (
 
{statusCode}
{description}
{example && (toggleExample ? (
{example && toggleExample && (
{example}
)}
); }