"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _react = _interopRequireDefault(require("react"));
require("./address-list-item.scss");
var _childrenNodeHandle = require("../../utils/children-node-handle");
var _excluded = ["children", "phone", "name", "address", "tag", "selected", "onClick", "onRemove", "onEdit"];
var AddressListItem = function AddressListItem(_ref) {
  var children = _ref.children,
    phone = _ref.phone,
    name = _ref.name,
    address = _ref.address,
    tag = _ref.tag,
    selected = _ref.selected,
    _ref$onClick = _ref.onClick,
    onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
    onRemove = _ref.onRemove,
    onEdit = _ref.onEdit,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _otherProps = otherProps || {};
  return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
    className: "address-list-item " + (selected ? 'selected' : '')
  }, _otherProps), /*#__PURE__*/_react["default"].createElement("div", {
    className: "address-list-item-circle",
    onClick: onClick
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "address-list-item-content"
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "address-list-item-header"
  }, (0, _childrenNodeHandle.convertChildren)(children, 'name', {
    children: [name],
    className: 'address-list-item-name'
  }), (0, _childrenNodeHandle.convertChildren)(children, 'tag', {
    children: [tag],
    className: 'address-list-item-tag'
  })), (0, _childrenNodeHandle.convertChildren)(children, 'address', {
    children: [address],
    className: 'address-list-item-address'
  }), (0, _childrenNodeHandle.convertChildren)(children, 'phone', {
    children: [phone],
    className: 'address-list-item-phone'
  }), /*#__PURE__*/_react["default"].createElement("div", {
    className: "address-list-item-actions"
  }, /*#__PURE__*/_react["default"].createElement("button", {
    onClick: onRemove
  }, "REMOVE"), /*#__PURE__*/_react["default"].createElement("button", {
    onClick: onEdit
  }, "EDIT"))));
};
AddressListItem.displayName = 'AddressListItem';
var _default = exports["default"] = AddressListItem;