22 lines
430 B
TypeScript
22 lines
430 B
TypeScript
import type { ElementType, ReactNode } from "react";
|
|
|
|
interface ContainerProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
as?: ElementType;
|
|
}
|
|
|
|
export function Container({
|
|
children,
|
|
className = "",
|
|
as: Tag = "div",
|
|
}: ContainerProps) {
|
|
return (
|
|
<Tag
|
|
className={`mx-auto w-full max-w-[var(--container-max-width)] px-[var(--container-padding-x)] ${className}`.trim()}
|
|
>
|
|
{children}
|
|
</Tag>
|
|
);
|
|
}
|