Files
mtdb_movie/common/resources/client/text-editor/menubar/history-buttons.tsx
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

33 lines
812 B
TypeScript
Executable File

import React from 'react';
import {IconButton} from '../../ui/buttons/icon-button';
import {UndoIcon} from '../../icons/material/Undo';
import {RedoIcon} from '../../icons/material/Redo';
import {MenubarButtonProps} from './menubar-button-props';
export function HistoryButtons({editor}: MenubarButtonProps) {
return (
<span>
<IconButton
size="md"
disabled={!editor.can().undo()}
onClick={() => {
editor.commands.focus();
editor.commands.undo();
}}
>
<UndoIcon />
</IconButton>
<IconButton
size="md"
disabled={!editor.can().redo()}
onClick={() => {
editor.commands.focus();
editor.commands.redo();
}}
>
<RedoIcon />
</IconButton>
</span>
);
}