DocSection.tsx 726 B

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