import { ActionIcon, type ActionIconProps, Tooltip, VisuallyHidden } from '@mantine/core'; import { useState } from 'react'; import type { SpecialIDProps } from '../FormerControllers.types'; const IconButtonCtrl = ( props: { onClick?: (e?: React.MouseEvent) => Promise; } & Omit & SpecialIDProps ) => { const [loading, setLoading] = useState(false); return ( { if (props.onClick) { setLoading(true); props.onClick(e).finally(() => setLoading(false)); } }} > {props.children} Action Button: {props.tooltip ?? props.sid ?? ''} ); }; export { IconButtonCtrl }; export default IconButtonCtrl;