import React from 'react'; import { FiCheck } from 'react-icons/fi'; type DefaultButtonProps = JSX.IntrinsicElements['button']; interface ButtonProps extends DefaultButtonProps { icon?: JSX.Element; circle?: boolean; active?: boolean; border?: boolean; confirmAction?: () => void; } export const Button = ({ icon, circle, className, active, border, confirmAction, disabled, children, ...props }: ButtonProps): JSX.Element => { const [hasConfirmed, setHasConfirmed] = React.useState(false); const handleConfirm = (): void => { if (typeof confirmAction == 'function') { if (hasConfirmed) { void confirmAction(); } setHasConfirmed(true); setTimeout(() => { setHasConfirmed(false); }, 3000); } }; return ( ); };