import { Button, ButtonProps } from 'antd'; import React, { useState } from 'react'; import { useEvent } from '../hooks/useEvent'; export const AutoLoadingButton: React.FC = React.memo((props) => { const [loading, setLoading] = useState(false); const handleClick = useEvent( async (e: React.MouseEvent) => { setLoading(true); await props.onClick?.(e); setLoading(false); } ); return