"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

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

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

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

var _box = _interopRequireDefault(require("../box"));

var _avatar = _interopRequireDefault(require("../avatar"));

var _typography = require("../typography");

var _theme = _interopRequireDefault(require("./theme.css"));

var _excluded = ["suggestion", "selected"];

var EmailSuggestion = function EmailSuggestion(_ref) {
  var suggestion = _ref.suggestion,
      selected = _ref.selected,
      rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  return /*#__PURE__*/_react.default.createElement(_box.default, (0, _extends2.default)({
    backgroundColor: selected ? 'neutral' : undefined,
    backgroundTint: "light",
    display: "flex",
    alignItems: "center",
    paddingHorizontal: 3,
    paddingVertical: 2,
    className: _theme.default['autocomplete-option']
  }, rest), /*#__PURE__*/_react.default.createElement(_avatar.default, {
    size: "small",
    id: suggestion.id,
    fullName: suggestion.label,
    title: suggestion.label,
    marginRight: 3
  }), /*#__PURE__*/_react.default.createElement(_typography.TextBody, null, suggestion.email), suggestion.label && /*#__PURE__*/_react.default.createElement(_typography.TextBody, {
    tint: "darkest",
    color: "neutral",
    marginLeft: 1
  }, "(", suggestion.label, ")"));
};

var _default = EmailSuggestion;
exports.default = _default;