2023-07-27 22:04:25 +03:00
|
|
|
interface MiniButtonProps
|
|
|
|
extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'title' > {
|
|
|
|
icon?: React.ReactNode
|
|
|
|
tooltip?: string
|
2023-08-22 23:45:59 +03:00
|
|
|
noHover?: boolean
|
2023-07-27 22:04:25 +03:00
|
|
|
}
|
|
|
|
|
2023-09-04 19:12:27 +03:00
|
|
|
function MiniButton({ icon, tooltip, children, noHover, tabIndex, ...props }: MiniButtonProps) {
|
2023-07-27 22:04:25 +03:00
|
|
|
return (
|
|
|
|
<button type='button'
|
|
|
|
title={tooltip}
|
2023-09-04 19:12:27 +03:00
|
|
|
tabIndex={tabIndex ?? -1}
|
2023-08-23 22:57:25 +03:00
|
|
|
className={`px-1 py-1 font-bold rounded-full cursor-pointer whitespace-nowrap disabled:cursor-not-allowed clr-btn-clear ${noHover ? 'outline-none' : 'clr-hover'}`}
|
2023-07-27 22:04:25 +03:00
|
|
|
{...props}
|
|
|
|
>
|
|
|
|
{icon && <span>{icon}</span>}
|
|
|
|
{children}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default MiniButton;
|