|
1
|
import React from "react" |
|
2
|
import clsx from "clsx" |
|
3
|
import SectionDivider from "../Divider" |
|
4
|
import { forwardRef } from "react" |
|
5
|
import { WideSection } from "docs-ui" |
|
6
|
|
|
7
|
type SectionContainerProps = { |
|
8
|
children: React.ReactNode |
|
9
|
noTopPadding?: boolean |
|
10
|
noDivider?: boolean |
|
11
|
className?: string |
|
12
|
} |
|
13
|
|
|
14
|
const SectionContainer = forwardRef<HTMLDivElement, SectionContainerProps>( |
|
15
|
function SectionContainer( |
|
16
|
{ children, noTopPadding = false, noDivider = false, className }, |
|
17
|
ref |
|
18
|
) { |
|
19
|
return ( |
|
20
|
<div |
|
21
|
ref={ref} |
|
22
|
className={clsx( |
|
23
|
"relative pb-4 md:pb-7", |
|
24
|
!noTopPadding && "pt-7", |
|
25
|
className |
|
26
|
)} |
|
27
|
data-testid="section-container" |
|
28
|
> |
|
29
|
<WideSection>{children}</WideSection> |
|
30
|
{!noDivider && <SectionDivider />} |
|
31
|
</div> |
|
32
|
) |
|
33
|
} |
|
34
|
) |
|
35
|
|
|
36
|
export default SectionContainer |