mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
28 lines
634 B
TypeScript
28 lines
634 B
TypeScript
import React from 'react'
|
|
|
|
export type ContainerMaxWidth = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
|
|
export interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
children?: React.ReactNode
|
|
maxWidth?: ContainerMaxWidth
|
|
disableGutters?: boolean
|
|
testId?: string
|
|
}
|
|
|
|
export const Container: React.FC<ContainerProps> = ({
|
|
children,
|
|
maxWidth,
|
|
disableGutters,
|
|
className = '',
|
|
testId,
|
|
...props
|
|
}) => (
|
|
<div
|
|
className={`container ${maxWidth ? `container--${maxWidth}` : ''} ${disableGutters ? 'container--no-gutters' : ''} ${className}`}
|
|
data-testid={testId}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|