2023-09-11 20:31:54 +03:00
|
|
|
import { TokenID } from '../../../models/rslang';
|
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-08-27 16:35:17 +03:00
|
|
|
onClick={() => onInsert(TokenID.ID_LOCAL, text)}
|
2023-07-22 03:18:48 +03:00
|
|
|
title={tooltip}
|
|
|
|
tabIndex={-1}
|
2023-10-23 18:22:55 +03:00
|
|
|
className='w-[2.25rem] h-6 cursor-pointer disabled:cursor-default border rounded-none clr-hover clr-btn-clear'
|
2023-07-22 03:18:48 +03:00
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</button>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
export default RSLocalButton;
|