import type { FC, MouseEvent } from 'react'; import React, { useCallback } from 'react'; import type { ButtonProps } from './Button.js'; import { Button as BaseWalletConnectionButton } from './Button.js'; import { useWalletModal } from './useWalletModal.js'; export const WalletModalButton: FC = ({ children = 'Select Wallet', onClick, ...props }) => { const { visible, setVisible } = useWalletModal(); const handleClick = useCallback( (event: MouseEvent) => { if (onClick) onClick(event); if (!event.defaultPrevented) setVisible(!visible); }, [onClick, setVisible, visible] ); return ( {children} ); };