mango-v4-ui/components/shared/Button.tsx

32 lines
709 B
TypeScript
Raw Normal View History

2022-05-03 21:20:14 -07:00
import { FunctionComponent, ReactNode } from 'react'
interface ButtonProps {
onClick?: (e?: React.MouseEvent) => void
disabled?: boolean
className?: string
primary?: boolean
children?: ReactNode
}
const Button: FunctionComponent<ButtonProps> = ({
children,
onClick,
disabled = false,
className,
...props
}) => {
return (
<button
onClick={onClick}
disabled={disabled}
2022-06-22 04:55:03 -07:00
className={`whitespace-nowrap rounded-full bg-mango-500 px-8 py-2 font-bold text-mango-200 hover:brightness-[1.1] focus:outline-none
2022-05-03 21:20:14 -07:00
disabled:cursor-not-allowed disabled:hover:brightness-100 ${className}`}
{...props}
>
{children}
</button>
)
}
export default Button