mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
29 lines
542 B
TypeScript
29 lines
542 B
TypeScript
import cn from 'classnames'
|
|
import React, { FC } from 'react'
|
|
|
|
interface ContainerProps {
|
|
className?: string
|
|
children?: any
|
|
el?: HTMLElement
|
|
clean?: boolean
|
|
}
|
|
|
|
const Container: FC<ContainerProps> = ({
|
|
children,
|
|
className,
|
|
el = 'div',
|
|
clean,
|
|
}) => {
|
|
const rootClassName = cn(className, {
|
|
'mx-auto max-w-8xl px-6': !clean,
|
|
})
|
|
|
|
let Component: React.ComponentType<
|
|
React.HTMLAttributes<HTMLDivElement>
|
|
> = el as any
|
|
|
|
return <Component className={rootClassName}>{children}</Component>
|
|
}
|
|
|
|
export default Container
|