import React from "react";
import './back-button.css';
import Iconsvg from '../Icon/Icon';


type Props = {
    buttonLabel: string,
    iconName: any,
    icon: boolean,
    tooltipShow?: boolean,
    tooltipContent?: string,
    background?:boolean,
    variant?: 'default' |'primary' | 'secondary',
    size?: 'default' | 'small' | 'medium' | 'large',
}


const BackButton = (props:Props) => {
    const {buttonLabel, iconName, icon, tooltipShow, tooltipContent, variant,background, size} = props;
    return (
        <div className={`back-button ${variant ? `btn-${variant}` : ''} ${size ? `btn-size-${size}` : ''} ${background ? 'background-disable' : ''}`}>
            {tooltipShow && <span className="tooltiptext">{tooltipContent}</span>}
            <button type="button">
              {icon && <Iconsvg name={iconName}/>}  {buttonLabel}
            </button>
        </div>
    );
}

export default BackButton;