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