ConceptPortal-public/rsconcept/frontend/src/components/Common/MiniButton.tsx

27 lines
664 B
TypeScript
Raw Normal View History

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' > {
icon: React.ReactNode
2023-07-27 22:04:25 +03:00
tooltip?: string
2023-08-22 23:45:59 +03:00
noHover?: boolean
dimensions?: string
2023-07-27 22:04:25 +03:00
}
function MiniButton({
icon, tooltip, noHover, tabIndex,
dimensions='w-fit h-fit',
...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}
className={`px-1 py-1 rounded-full cursor-pointer disabled:cursor-not-allowed clr-btn-clear ${noHover ? 'outline-none' : 'clr-hover'} ${dimensions}`}
2023-07-27 22:04:25 +03:00
{...props}
>
{icon}
2023-07-27 22:04:25 +03:00
</button>
);
}
export default MiniButton;