"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.ViewsDropdownPrefix = void 0;
exports._ViewsDropdownPrefix = _ViewsDropdownPrefix;
var _designSystem = require("@wix/design-system");
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CollectionViewsDropdown/ViewsDropdownPrefix.tsx";
function _ViewsDropdownPrefix(props) {
  const {
    state
  } = props;
  const {
    views
  } = state;
  const {
    collection: {
      translate: t
    }
  } = views;
  if (!views.isCurrentViewSelected || views.isCurrentViewSelected && state.isViewChanged) {
    return /*#__PURE__*/_react.default.createElement(_designSystem.Input.Affix, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 27,
        columnNumber: 7
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      dataHook: "view-pending-changes",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 28,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.Tooltip, {
      appendTo: "window",
      content: views.isCurrentViewSelected ? t('cairo.manageView.tooltip') : t('cairo.manageView.unsaved.tooltip'),
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 29,
        columnNumber: 11
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      verticalAlign: "middle",
      color: "D40",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 37,
        columnNumber: 13
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.StatusAlertSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 38,
        columnNumber: 15
      }
    })))));
  }
  if (views.isDefaultView) {
    return /*#__PURE__*/_react.default.createElement(_designSystem.Input.Affix, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 48,
        columnNumber: 7
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
      dataHook: "view-default",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 49,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.FlagSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 50,
        columnNumber: 11
      }
    })));
  }
  return null;
}
const ViewsDropdownPrefix = exports.ViewsDropdownPrefix = (0, _mobxReactLite.observer)(_ViewsDropdownPrefix);
//# sourceMappingURL=ViewsDropdownPrefix.js.map