mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
31 lines
659 B
JavaScript
31 lines
659 B
JavaScript
import React from 'react';
|
|
import classNames from 'classnames';
|
|
import Icon from './Icon';
|
|
import styles from './Button.module.css';
|
|
|
|
export default function Button({
|
|
type = 'button',
|
|
icon,
|
|
size,
|
|
variant,
|
|
children,
|
|
className,
|
|
onClick = () => {},
|
|
}) {
|
|
return (
|
|
<button
|
|
type={type}
|
|
className={classNames(styles.button, className, {
|
|
[styles.small]: size === 'S',
|
|
[styles.large]: size === 'L',
|
|
[styles.action]: variant === 'action',
|
|
[styles.danger]: variant === 'danger',
|
|
})}
|
|
onClick={onClick}
|
|
>
|
|
{icon && <Icon icon={icon} size={size} />}
|
|
{children}
|
|
</button>
|
|
);
|
|
}
|