import { observer } from "mobx-react";
import { Button } from "@humansignal/ui";
import {
FullscreenExitOutlined,
FullscreenOutlined,
RedoOutlined,
RollbackOutlined,
SettingOutlined,
UndoOutlined,
} from "@ant-design/icons";
import styles from "./Panel.module.css";
import Hint from "../Hint/Hint";
/**
* Panel component with buttons:
* Undo
* Redo
* Reset
* Show Instructions
* Settings
*/
export default observer(({ store }) => {
const annotation = store.annotationStore.selected;
const { history } = annotation;
const classname = [styles.block, styles.block__controls, store.annotationStore.viewingAll ? styles.hidden : ""]
.filter(Boolean)
.join(" ");
const panelClassName = cn("panel").toClassName();
return (
}
disabled={!history?.canUndo}
onClick={(ev) => {
annotation?.undo();
ev.preventDefault();
}}
>
Undo
{store.settings.enableHotkeys && store.settings.enableTooltips && [ Ctrl+z ]}
}
onClick={(ev) => {
annotation?.redo();
ev.preventDefault();
}}
>
Redo
}
onClick={() => {
history && history.reset();
}}
>
Reset
{store.setPrelabeling && (
)}
{store.hasInterface("debug") && (
{history.undoIdx} / {history.history.length}
{history.isFrozen && " (frozen)"}
)}
{store.description && store.showingDescription && (
)}
{store.description && !store.showingDescription && (
)}
}
onClick={(ev) => {
store.toggleSettings();
ev.preventDefault();
return false;
}}
/>
: }
onClick={(ev) => {
store.settings.toggleFullscreen();
ev.preventDefault();
return false;
}}
/>
);
});