"use strict";

exports.__esModule = true;
exports.ArchivedItemsListItem = void 0;
var _designSystem = require("@wix/design-system");
var _react = _interopRequireWildcard(require("react"));
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _react2 = require("@wix/bex-core/react");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/ArchivedItemsPanel/ArchivedItemsListItem.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _ArchivedItemsListItem({
  item,
  showDivider,
  onRestore,
  onDelete,
  dataHook = 'custom-columns'
}) {
  const {
    translate: t
  } = (0, _react2.useWixPatternsContainer)();
  const style = (0, _react.useMemo)(() => ({
    padding: '0 6px',
    wordBreak: 'break-word'
  }), []);
  const moreActionsButton = /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu, {
    textSize: "small",
    placement: "bottom-end",
    dataHook: `${dataHook}-archived-item-options-${item.id}`,
    triggerElement: /*#__PURE__*/_react.default.createElement(_designSystem.Tooltip, {
      content: t('cairo.archivedFields.more-actions.tooltip'),
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 45,
        columnNumber: 9
      }
    }, /*#__PURE__*/_react.default.createElement(_designSystem.IconButton, {
      size: "tiny",
      dataHook: `${dataHook}-archived-item-options-trigger`,
      skin: "light",
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 46,
        columnNumber: 11
      }
    }, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.MoreSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 51,
        columnNumber: 13
      }
    }))),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 40,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.MenuItem, {
    dataHook: `${dataHook}-archived-item-options-restore`,
    prefixIcon: /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.UndoSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 58,
        columnNumber: 21
      }
    }),
    text: t('cairo.archivedFields.more-actions.restore'),
    onClick: () => onRestore(item),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 56,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.MenuItem, {
    dataHook: `${dataHook}-archived-item-options-delete`,
    prefixIcon: /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.DeleteSmall, {
      __self: this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 65,
        columnNumber: 21
      }
    }),
    text: t('cairo.archivedFields.more-actions.delete'),
    onClick: () => onDelete(item),
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 63,
      columnNumber: 7
    }
  }));
  return /*#__PURE__*/_react.default.createElement(_designSystem.TableListItem, {
    showDivider: showDivider,
    "data-hook": `${dataHook}-archived-item-${item.id}`,
    options: [{
      value: /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 79,
          columnNumber: 13
        }
      }, /*#__PURE__*/_react.default.createElement("div", {
        style: style,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 80,
          columnNumber: 15
        }
      }, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
        size: "small",
        dataHook: `${dataHook}-archived-item-label`,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 81,
          columnNumber: 17
        }
      }, item.label || item.id)))
    }, {
      value: moreActionsButton,
      align: 'right'
    }],
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 73,
      columnNumber: 5
    }
  });
}
const ArchivedItemsListItem = exports.ArchivedItemsListItem = _ArchivedItemsListItem;
//# sourceMappingURL=ArchivedItemsListItem.js.map