import React, {type ReactNode} from "react";
import clsx from "clsx";

type PageContainerProps = React.HTMLAttributes<HTMLDivElement> & {
    /** Content to render inside the container */
    children: ReactNode;
};

/**
 * Container for a page providing the correct dimensions to its children
 * @param children Children the page, i.e., header and body
 * @param className Optional additional styles
 * @param props all other props by html div that might be needed
 * @constructor
 */
export default function PageContainer({children, className, ...rest}: PageContainerProps): ReactNode {
    return (
        <div
            {...rest}
            className={clsx(
                "flex items-center w-screen justify-center min-h-screen ;",
                className
            )}
        >
            {children}
        </div>
    );
}