File size: 563 Bytes
c03d895
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Icon from './Icon.jsx';

export default function Button({ variant, compact, grow, iconOnly, icon, className = '', children, ...rest }) {
    const cls = [
        'btn',
        variant === 'primary' && 'btn--apply',
        compact && 'btn--compact',
        grow && 'btn--grow',
        iconOnly && 'btn--icon-only',
        className,
    ].filter(Boolean).join(' ');
    return (
        <button type="button" className={cls} {...rest}>
            {icon && <Icon name={icon} className="btn__icon" />}
            {children}
        </button>
    );
}