import {LayoutProps} from "./Layout.props";
import styles from "./Layout.module.css"
import cn from "classnames";
import {Component, FunctionComponent} from "react";
const Layout = ({ children }: LayoutProps): JSX.Element => {
    return(
        <div className={styles.container} >
            {children}
        </div>
    );
};

export const withLayout = <T extends Record<string, unknown>>(Component: FunctionComponent<T>) => {
    return function withLayoutComponent(props: T): JSX.Element {
        return(
            <Layout>
                <Component {...props} />
            </Layout>
        );
    };
};