import type { ReactNode } from 'react' /** * 文档的一节:锚点 + 标题 + 说明。 * * 每个组件一节,节内再用 Demo 摆具体用法,方便直接翻着找。 */ type SectionProps = { /** 锚点 id,与左侧目录一致 */ id: string title: string /** 右侧灰字,通常写组件名或导出路径 */ api?: string desc?: ReactNode children: ReactNode } export function Section({ id, title, api, desc, children }: SectionProps) { return (

{title}

{api !== undefined && {api}}
{desc !== undefined &&

{desc}

} {children}
) }