export default function Button( {
	children,
	variant = 'primary',
	size = 'md',
	isBusy = false,
	disabled = false,
	icon = null,
	type = 'button',
	...rest
} ) {
	const classes = [
		'rtgw-btn',
		`rtgw-btn--${ variant }`,
		`rtgw-btn--${ size }`,
		isBusy ? 'is-busy' : '',
	]
		.filter( Boolean )
		.join( ' ' );

	return (
		<button type={ type } className={ classes } disabled={ disabled || isBusy } { ...rest }>
			{ icon && <span className="rtgw-btn__icon">{ icon }</span> }
			<span className="rtgw-btn__label">{ children }</span>
		</button>
	);
}
