umami/components/Button.js

14 lines
413 B
JavaScript
Raw Normal View History

import React from 'react';
import classNames from 'classnames';
import Icon from './Icon';
import styles from './Button.module.css';
2020-08-06 04:04:02 +02:00
export default function Button({ icon, type = 'button', children, className, onClick = () => {} }) {
return (
2020-08-06 04:04:02 +02:00
<button type={type} className={classNames(styles.button, className)} onClick={onClick}>
{icon && <Icon icon={icon} />}
{children}
</button>
);
}