import { Collapsible } from "./Collapsible" import type { JSX, ComponentProps, ReactElement } from "react" type DetailsProps = { /** * Summary is provided as props, optionally including the wrapping * `` tag */ summary?: ReactElement | string } & ComponentProps<"details"> export default function Details({ summary, children, ...props }: DetailsProps): JSX.Element { return (
{summary !== undefined && summary} {summary === undefined && Fallback}
{children}
) }