mango-v4-ui/components/account/ActionsLinkButton.tsx

27 lines
583 B
TypeScript
Raw Permalink Normal View History

2023-01-05 01:04:09 -08:00
import { LinkButton } from '@components/shared/Button'
2023-10-03 22:05:16 -07:00
import useMangoAccount from 'hooks/useMangoAccount'
2023-01-05 01:04:09 -08:00
import { ReactNode } from 'react'
const ActionsLinkButton = ({
children,
disabled,
2023-01-05 01:04:09 -08:00
onClick,
}: {
children: ReactNode
disabled?: boolean
2023-01-05 01:04:09 -08:00
onClick: () => void
}) => {
2023-10-03 22:05:16 -07:00
const { mangoAccountAddress } = useMangoAccount()
2023-01-05 01:04:09 -08:00
return (
<LinkButton
2023-04-20 19:32:20 -07:00
className="w-full whitespace-nowrap text-left font-normal"
2023-10-03 22:05:16 -07:00
disabled={!mangoAccountAddress || disabled}
2023-01-05 01:04:09 -08:00
onClick={onClick}
>
{children}
</LinkButton>
)
}
export default ActionsLinkButton