2023-07-27 22:04:25 +03:00
|
|
|
interface MiniButtonProps
|
2023-11-05 16:31:49 +03:00
|
|
|
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'title' | 'children' > {
|
2023-09-15 23:29:52 +03:00
|
|
|
icon: React.ReactNode
|
2023-07-27 22:04:25 +03:00
|
|
|
tooltip?: string
|
2023-08-22 23:45:59 +03:00
|
|
|
noHover?: boolean
|
2023-09-15 23:29:52 +03:00
|
|
|
dimensions?: string
|
2023-07-27 22:04:25 +03:00
|
|
|
}
|
|
|
|
|
2023-09-15 23:29:52 +03:00
|
|
|
function MiniButton({
|
2023-11-06 18:03:23 +03:00
|
|
|
icon, tooltip, noHover, tabIndex,
|
|
|
|
dimensions='w-fit h-fit',
|
2023-11-27 13:50:56 +03:00
|
|
|
...restProps
|
2023-09-15 23:29:52 +03:00
|
|
|
}: MiniButtonProps) {
|
2023-07-27 22:04:25 +03:00
|
|
|
return (
|
2023-12-05 01:22:44 +03:00
|
|
|
<button type='button'
|
|
|
|
title={tooltip}
|
|
|
|
tabIndex={tabIndex ?? -1}
|
|
|
|
className={`px-1 py-1 rounded-full cursor-pointer disabled:cursor-not-allowed clr-btn-clear ${noHover ? 'outline-none' : 'clr-hover'} ${dimensions}`}
|
|
|
|
{...restProps}
|
|
|
|
>
|
|
|
|
{icon}
|
|
|
|
</button>);
|
2023-07-27 22:04:25 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export default MiniButton;
|