import { PropsWithChildren } from 'react';
import './index.scss'
import { Button as TaroButton, ButtonProps } from '@tarojs/components';
import classNames from 'classnames';

interface IButtonProps extends ButtonProps {
    fill?: boolean;
    round?: boolean;
    color?: "white"
}

const Button = (props: PropsWithChildren<IButtonProps>) => {
    const { fill = false, color, round = true, ...otherProps } = props;
    return (
        <TaroButton
            {...otherProps}
            className={classNames("button", {
                "button-fill": fill,
                "button-round": round,
                [`button-${color}`]: color,
                [otherProps.className || "a"]: !!otherProps.className,
            })}
        >
            {props.children}
        </TaroButton>
    )
}

export default Button;