"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.BasketPreview = void 0;

var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));

var _react = _interopRequireDefault(require("react"));

var _lib = require("@sentecacommerce-theme/lib");

var _Common = require("../../../../../Common");

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _UI = require("../../../UI");

var _Item = require("./Components/Item");

var _templateObject;

var BasketPreview = function BasketPreview() {
  var _useBasketItemList = (0, _lib.useBasketItemList)(),
      lineItems = _useBasketItemList.lineItems;

  var isLoading = !lineItems;
  var labels = (0, _lib.useLocalLabels)();
  return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_UI.CheckoutTitle, {
    data: labels.products,
    small: true
  }), /*#__PURE__*/_react["default"].createElement(List, null, !isLoading && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, lineItems == null ? void 0 : lineItems.map(function (item) {
    return /*#__PURE__*/_react["default"].createElement(_Item.Item, {
      item: item,
      key: item._id
    });
  }))));
};

exports.BasketPreview = BasketPreview;
var List = (0, _styledComponents["default"])(_Common.Typography).attrs({
  className: 'row g-4',
  as: 'ul',
  variant: 6
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  line-height: 1.3;\n  list-style: none;\n"])));
//# sourceMappingURL=index.js.map