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

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

/**
 * A layout for horizontally aligning buttons as usually a save button is accompanied by a cancel button
 * @param children Children of the layout, i.e., buttons
 * @param className Optional additional styles
 * @param props all other props by html div that might be needed
 * @constructor
 */
export default function ButtonGroupLayout({children, className, ...rest}: ButtonGroupLayoutProps) {
    return (
        <div
            {...rest}
            className={clsx(
                "flex gap-4 mt-8",
                className
            )}
        >
            {children}
        </div>
    );
}