2023-07-28 00:03:37 +03:00
|
|
|
import { TokenID } from '../../../utils/enums';
|
2023-07-22 03:18:48 +03:00
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
interface RSLocalButtonProps {
|
2023-07-22 03:18:48 +03:00
|
|
|
text: string
|
|
|
|
tooltip: string
|
|
|
|
disabled?: boolean
|
|
|
|
onInsert: (token: TokenID, key?: string) => void
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
function RSLocalButton({ text, tooltip, disabled, onInsert }: RSLocalButtonProps) {
|
2023-07-22 03:18:48 +03:00
|
|
|
return (
|
|
|
|
<button
|
|
|
|
type='button'
|
|
|
|
disabled={disabled}
|
2023-07-25 20:27:29 +03:00
|
|
|
onClick={() => { onInsert(TokenID.ID_LOCAL, text); }}
|
2023-07-22 03:18:48 +03:00
|
|
|
title={tooltip}
|
|
|
|
tabIndex={-1}
|
|
|
|
className='w-[1.5rem] h-7 cursor-pointer border rounded-none clr-btn-clear'
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
export default RSLocalButton;
|