2020-08-04 08:20:35 +02:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
import Icon from './Icon';
|
|
|
|
import styles from './Button.module.css';
|
|
|
|
|
2020-08-07 09:24:01 +02:00
|
|
|
export default function Button({
|
|
|
|
type = 'button',
|
|
|
|
icon,
|
|
|
|
size,
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
onClick = () => {},
|
|
|
|
}) {
|
2020-08-04 08:20:35 +02:00
|
|
|
return (
|
2020-08-07 09:24:01 +02:00
|
|
|
<button
|
|
|
|
type={type}
|
|
|
|
className={classNames(styles.button, className, {
|
|
|
|
[styles.small]: size === 'S',
|
|
|
|
[styles.large]: size === 'L',
|
|
|
|
})}
|
|
|
|
onClick={onClick}
|
|
|
|
>
|
|
|
|
{icon && <Icon icon={icon} size={size} />}
|
2020-08-04 08:20:35 +02:00
|
|
|
{children}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|