"use strict";

exports.__esModule = true;
exports.useShowChromQualScores = exports.chromatogramMenu = void 0;
var _react = _interopRequireDefault(require("react"));
var _core = require("@blueprintjs/core");
var _tgUseLocalStorageState = _interopRequireDefault(require("tg-use-local-storage-state"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
var useShowChromQualScores = function useShowChromQualScores() {
  return (0, _tgUseLocalStorageState["default"])("showChromQualScores", {
    defaultValue: true
  });
};
exports.useShowChromQualScores = useShowChromQualScores;
var ShowChromQualScoresMenu = function ShowChromQualScoresMenu() {
  return function ShowChromQualScoresMenu(props) {
    var _useShowChromQualScor = useShowChromQualScores(),
      showChromQualScores = _useShowChromQualScor[0],
      setShowChromQualScores = _useShowChromQualScor[1];
    return /*#__PURE__*/_react["default"].createElement(_core.MenuItem, _extends({}, props, {
      text: "Show Quality Scores",
      shouldDismissPopover: false,
      onClick: function onClick() {
        setShowChromQualScores(!showChromQualScores);
      },
      icon: showChromQualScores ? "small-tick" : "blank"
    }));
  };
};
var chromatogramMenu = {
  text: "Chromatogram (Quality Scores)",
  cmd: "showChromQualScoresMenu",
  component: ShowChromQualScoresMenu(),
  shouldDismissPopover: false
};
exports.chromatogramMenu = chromatogramMenu;