import platform from "platform";
import React from "react";
import { ReactComponent as UndoIcon } from "@svgr/webpack!../../../assets/icons/undo-icon.svg";
import { ReactComponent as RedoIcon } from "@svgr/webpack!../../../assets/icons/redo-icon.svg";
import { ReactComponent as ArrowIcon } from "@svgr/webpack!../../../assets/icons/arrow-icon.svg";
import Action from "../Action";
var metaKey = platform.os.family === "OS X" ? "CMD" : "CTRL";
export var undo = {
  name: "pb-editor-toolbar-undo",
  type: "pb-editor-toolbar-bottom",
  renderAction: function renderAction() {
    var _window$g_app$_store$ = window.g_app._store.getState(),
        _window$g_app$_store$2 = _window$g_app$_store$.appBuilder.past,
        past = _window$g_app$_store$2 === void 0 ? [] : _window$g_app$_store$2;

    return /*#__PURE__*/React.createElement(Action // tooltip={`${i18n("PAGEBUIDER_OPT_UNDO")} (${metaKey}+Z)`}
    , {
      onClick: "undo" // text={i18n("PAGEBUIDER_OPT_UNDO")}
      ,
      icon: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UndoIcon, {
        className: past.length === 0 ? "formbuild-btn-default-color" : "formbuild-btn-action-color"
      }), /*#__PURE__*/React.createElement(ArrowIcon, {
        className: "pagebuilder-bar-opt-arrow"
      }))
    });
  }
};
export var redo = {
  name: "pb-editor-toolbar-redo",
  type: "pb-editor-toolbar-bottom",
  renderAction: function renderAction() {
    var _window$g_app$_store$3 = window.g_app._store.getState(),
        _window$g_app$_store$4 = _window$g_app$_store$3.appBuilder.future,
        future = _window$g_app$_store$4 === void 0 ? [] : _window$g_app$_store$4;

    return /*#__PURE__*/React.createElement(Action // tooltip={`${i18n("PAGEBUIDER_OPT_REDO")} (${metaKey}+SHIFT+Z)`}
    , {
      onClick: "redo" // text={i18n("PAGEBUIDER_OPT_REDO")}
      ,
      icon: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(RedoIcon, {
        className: future.length === 0 ? "formbuild-btn-default-color" : "formbuild-btn-action-color"
      }), /*#__PURE__*/React.createElement(ArrowIcon, {
        className: "pagebuilder-bar-opt-arrow"
      }))
    });
  }
};
//# sourceMappingURL=index.js.map