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

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

/**
 * Body for the content area of a page
 * @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 ContentBody({children, className, ...props}: ContentBodyProps) {
    return (
        <div
            {...props}
            className={clsx(
                "p-6 max-w-2xl mx-auto",
                className
            )}
        >
            {children}
        </div>
    );
}