dispatch/client/js/components/ui/Button.js
Ken-Håvard Lieng c704ebb042 Use react-icons
2020-04-29 03:13:35 +02:00

22 lines
401 B
JavaScript

import React from 'react';
import cn from 'classnames';
const Button = ({ children, category, className, icon: Icon, ...props }) => (
<button
className={cn(
{
[`button-${category}`]: category,
'icon-button': Icon && !children
},
className
)}
type="button"
{...props}
>
{Icon && <Icon />}
{children}
</button>
);
export default Button;