|
|
|
|
@ -7,6 +7,7 @@ import { useSelector, useDispatch } from 'react-redux';
|
|
|
|
|
const ButtonGroup = Button.Group;
|
|
|
|
|
|
|
|
|
|
interface ActionBarProps {
|
|
|
|
|
useDefault: boolean;
|
|
|
|
|
onSave?: () => void;
|
|
|
|
|
onUndo?: () => void;
|
|
|
|
|
onRedo?: () => void;
|
|
|
|
|
@ -17,6 +18,7 @@ interface ActionBarProps {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const ActionBar: React.FC<ActionBarProps> = ({
|
|
|
|
|
useDefault,
|
|
|
|
|
onSave,
|
|
|
|
|
onUndo,
|
|
|
|
|
onRedo,
|
|
|
|
|
@ -39,6 +41,8 @@ const ActionBar: React.FC<ActionBarProps> = ({
|
|
|
|
|
return (
|
|
|
|
|
<div className="action-bar">
|
|
|
|
|
<Button onClick={onSave} type="primary" shape="round" icon={<IconSave />}>保存</Button>
|
|
|
|
|
{useDefault && (
|
|
|
|
|
<>
|
|
|
|
|
<ButtonGroup style={{ marginLeft: 8 }}>
|
|
|
|
|
<Button
|
|
|
|
|
type="outline"
|
|
|
|
|
@ -67,7 +71,7 @@ const ActionBar: React.FC<ActionBarProps> = ({
|
|
|
|
|
icon={<IconUndo />}
|
|
|
|
|
onClick={onUndo}
|
|
|
|
|
disabled={!canUndo}
|
|
|
|
|
status='danger'
|
|
|
|
|
status="danger"
|
|
|
|
|
style={{ padding: '0 8px', backgroundColor: '#fff' }}
|
|
|
|
|
>
|
|
|
|
|
撤销
|
|
|
|
|
@ -83,6 +87,8 @@ const ActionBar: React.FC<ActionBarProps> = ({
|
|
|
|
|
重做
|
|
|
|
|
</Button>
|
|
|
|
|
</ButtonGroup>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|