mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Changes
This commit is contained in:
25
components/ui/Container/Container.tsx
Normal file
25
components/ui/Container/Container.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import cn from "classnames";
|
||||
import { FunctionComponent } from "react";
|
||||
import s from "./Container.module.css";
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
children?: any;
|
||||
el?: HTMLElement;
|
||||
}
|
||||
|
||||
const Container: FunctionComponent<Props> = ({
|
||||
children,
|
||||
className,
|
||||
el = "div",
|
||||
}) => {
|
||||
const rootClassName = cn(s.root, className);
|
||||
|
||||
let Component: React.ComponentType<React.HTMLAttributes<
|
||||
HTMLDivElement
|
||||
>> = el as any;
|
||||
|
||||
return <Component className={rootClassName}>{children}</Component>;
|
||||
};
|
||||
|
||||
export default Container;
|
Reference in New Issue
Block a user