import React from 'react' import classNames from 'classnames' import './index.scss' interface Props extends React.DetailedHTMLProps< React.ButtonHTMLAttributes, HTMLButtonElement > { accessoryIcon?: React.ReactNode active?: boolean blended?: boolean contained?: boolean buttonSize?: 'small' | 'medium' | 'large' text?: string } const defaultProps = { active: false, blended: false, contained: false, buttonSize: 'medium' as const, } const Button = React.forwardRef(function button( { accessoryIcon, active, blended, contained, buttonSize, text, ...props }, forwardedRef ) { const classes = classNames( { Button: true, Active: active, Blended: blended, Contained: contained, }, buttonSize, props.className ) const hasAccessory = () => { if (accessoryIcon) return {accessoryIcon} } const hasText = () => { if (text) return {text} } return ( ) }) Button.defaultProps = defaultProps export default Button