import {forwardRef} from "react";
import {buttonMainProps} from "../button-skeleton/button.types";
import {ButtonSkeleton} from "../button-skeleton/button-skeleton";

/**
 * Button component
 ** description
 */

export const Button = forwardRef(

    (props : buttonMainProps, ref) => (
        <ButtonSkeleton {...props}
                        ref={ref}
                        disabled={props.disabled}
                        variant={props.variant ? props.variant : "filled"}>
            {
                props.icon ?
                    <span className={"m3 m3-icon"}>
                    {props.icon}
                </span>
                    : <></>
            }
            <span className={"label-large"}>
                    {props.children}
                </span>
        </ButtonSkeleton>
    )

)