DocSection.tsx24 lines · main
1import { ReactNode } from 'react'
2import { cn } from 'ui'
3
4interface DocSectionProps {
5 title: ReactNode
6 id?: string
7 content: ReactNode
8 snippets?: ReactNode
9 className?: string
10}
11
12export const DocSection = ({ title, id, content, snippets, className }: DocSectionProps) => {
13 return (
14 <div className={cn('grid grid-cols-1 lg:grid-cols-2 border-b', className)} id={id}>
15 <article className="text-foreground-light prose prose-sm p-6 lg:py-10 lg:pr-10 lg:pl-0 flex-1">
16 {title && <h2 className="heading-subTitle mb-4">{title}</h2>}
17 {content}
18 </article>
19 <article className={cn('bg flex-1 lg:border-l space-y-6 px-6 pb-6 lg:py-10')}>
20 {snippets}
21 </article>
22 </div>
23 )
24}