import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["children", "phone", "name", "address", "tag", "selected", "onClick", "onRemove", "onEdit"];
import React from 'react';
import "./address-list-item.scss";
import { convertChildren } from "../../utils/children-node-handle";
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 = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "address-list-item " + (selected ? 'selected' : '')
  }, _otherProps), /*#__PURE__*/React.createElement("div", {
    className: "address-list-item-circle",
    onClick: onClick
  }), /*#__PURE__*/React.createElement("div", {
    className: "address-list-item-content"
  }, /*#__PURE__*/React.createElement("div", {
    className: "address-list-item-header"
  }, convertChildren(children, 'name', {
    children: [name],
    className: 'address-list-item-name'
  }), convertChildren(children, 'tag', {
    children: [tag],
    className: 'address-list-item-tag'
  })), convertChildren(children, 'address', {
    children: [address],
    className: 'address-list-item-address'
  }), convertChildren(children, 'phone', {
    children: [phone],
    className: 'address-list-item-phone'
  }), /*#__PURE__*/React.createElement("div", {
    className: "address-list-item-actions"
  }, /*#__PURE__*/React.createElement("button", {
    onClick: onRemove
  }, "REMOVE"), /*#__PURE__*/React.createElement("button", {
    onClick: onEdit
  }, "EDIT"))));
};
AddressListItem.displayName = 'AddressListItem';
export default AddressListItem;