import React, { forwardRef } from 'react';
import { ContainerProps } from './container.types';

export const Container = forwardRef<HTMLDivElement, ContainerProps>(
    ({ variant = 'filled', ...props }, ref) => {
        const extraClassStyles =
            `m3 m3-container m3-container-${variant} ${props.className ?? ''}`.trimEnd();

        return (
            <div {...props} className={extraClassStyles} ref={ref}>
                {props.children}
            </div>
        );
    },
);
