mirror of
https://github.com/ruisaraiva19/favycon.git
synced 2026-09-13 18:46:28 +05:00
* feat: upgrade dependencies * chore: update linter and CI workflows * chore: upgrade browserslist
32 lines
904 B
TypeScript
32 lines
904 B
TypeScript
import PropTypes from 'prop-types'
|
|
import classNames from 'classnames'
|
|
|
|
import styles from './index.module.scss'
|
|
|
|
export type ButtonProps = {
|
|
children: PropTypes.ReactNodeLike
|
|
variant: 'primary' | 'transparent' | 'regularTransparent' | 'modalClose'
|
|
weight: 'regular' | 'medium' | 'semiBold' | 'bold'
|
|
color: 'black' | 'gray' | 'white' | 'link'
|
|
background: 'bgLink' | 'bgGreen' | 'bgDarkGray'
|
|
} & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>
|
|
|
|
const Button = ({ children, variant, weight, color, background, ...props }: ButtonProps) => {
|
|
const className = classNames(styles[variant], styles[weight], styles[color], styles[background], props.className)
|
|
|
|
return (
|
|
<button {...props} className={className}>
|
|
{children}
|
|
</button>
|
|
)
|
|
}
|
|
|
|
Button.defaultProps = {
|
|
variant: 'primary',
|
|
weight: 'bold',
|
|
color: 'black',
|
|
background: '',
|
|
}
|
|
|
|
export { Button }
|