import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["suggestion", "selected"];
import React from 'react';
import Box from '../box';
import Avatar from '../avatar';
import { TextBody } from '../typography';
import theme from './theme.css';

var EmailSuggestion = function EmailSuggestion(_ref) {
  var suggestion = _ref.suggestion,
      selected = _ref.selected,
      rest = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/React.createElement(Box, _extends({
    backgroundColor: selected ? 'neutral' : undefined,
    backgroundTint: "light",
    display: "flex",
    alignItems: "center",
    paddingHorizontal: 3,
    paddingVertical: 2,
    className: theme['autocomplete-option']
  }, rest), /*#__PURE__*/React.createElement(Avatar, {
    size: "small",
    id: suggestion.id,
    fullName: suggestion.label,
    title: suggestion.label,
    marginRight: 3
  }), /*#__PURE__*/React.createElement(TextBody, null, suggestion.email), suggestion.label && /*#__PURE__*/React.createElement(TextBody, {
    tint: "darkest",
    color: "neutral",
    marginLeft: 1
  }, "(", suggestion.label, ")"));
};

export default EmailSuggestion;