mars-v2-frontend/components/Button.tsx
Linkie Link 27cdd1c954
Linter and prettier adjustments (#50)
* tidy: added eslintrc and prettierrc rules

* tidy: formated the files via ‚yarn format‘

* import sort improvements

* format script regex fix

* replace eslint import severity to warning

* remove staged file

Co-authored-by: Gustavo Mauricio <gustavo.mauricio58@gmail.com>
2022-11-09 10:04:06 +01:00

27 lines
625 B
TypeScript

import React from 'react'
type Props = {
children: string
className?: string
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void
disabled?: boolean
}
const Button = React.forwardRef<any, Props>(
({ children, className = '', onClick, disabled }, ref) => (
<button
ref={ref}
onClick={onClick}
className={`overflow-hidden text-ellipsis rounded-md bg-blue-500 py-2 px-5 text-sm font-semibold text-white ${className} ${
disabled ? 'opacity-40' : ''
}`}
disabled={disabled}
>
{children}
</button>
),
)
Button.displayName = 'Button'
export default Button