Skip to content

Commit

Permalink
redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
buddy-web3 committed Feb 23, 2024
1 parent 164c63f commit 7ea05a8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ type ButtonProps = {
className?: string
tooltip?: string
icon?: ReactNode
leftIcon?: ReactNode
}
const Button = ({children, action, tooltip, icon, leftIcon, className}: ButtonProps) => {
const Button = ({children, action, tooltip, icon, className}: ButtonProps) => {
const classes = ['button', className, tooltip && 'tooltip'].filter((i) => i).join(' ')
if (typeof action === 'string') {
return (
<Link to={action} className={classes} data-tooltip={tooltip}>
{leftIcon && leftIcon}
{children}
{icon && icon}
</Link>
)
}
return (
<button className={classes} onClick={action} data-tooltip={tooltip}>
{leftIcon && leftIcon}
{children}
{icon && icon}
</button>
Expand Down

0 comments on commit 7ea05a8

Please sign in to comment.