UNPKG

wix-style-react

Version:
63 lines 2.01 kB
import React from 'react'; import { classes } from './ContactItemBuilder.st.css'; import Avatar from '../Avatar/Avatar'; import Text from '../Text'; import { dataHooks } from './ContactItemBuilderDataHooks'; import PropTypes from 'prop-types'; import deprecationLog from '../utils/deprecationLog'; export var ContactItem = function ContactItem(props) { deprecationLog('This component is deprecated. Please use ListItemSelect instead'); return /*#__PURE__*/React.createElement("div", { className: classes.contactItemOption }, /*#__PURE__*/React.createElement("div", { className: classes.avatar }, /*#__PURE__*/React.createElement(Avatar, { name: props.title, size: "size30", imgProps: { src: props.imageUrl }, "data-hook": dataHooks.pickerOptionAvatar })), /*#__PURE__*/React.createElement("div", { className: classes.contactItemTitles }, /*#__PURE__*/React.createElement(Text, { ellipsis: true, size: "medium", weight: "normal", secondary: !props.selected, light: props.selected, dataHook: dataHooks.pickerOptionTitle }, props.title), props.subtitle ? /*#__PURE__*/React.createElement(Text, { ellipsis: true, size: "small", weight: "thin", secondary: !props.selected, light: props.selected, dataHook: dataHooks.pickerOptionSubtitle }, props.subtitle) : null)); }; ContactItem.propTypes = { title: PropTypes.string.isRequired, subtitle: PropTypes.string, imageUrl: PropTypes.string }; export var contactItemBuilder = function contactItemBuilder(_ref) { var id = _ref.id, title = _ref.title, subtitle = _ref.subtitle, imageUrl = _ref.imageUrl, disabled = _ref.disabled; return { id: id, disabled: disabled, value: function value(_ref2) { var selected = _ref2.selected; return /*#__PURE__*/React.createElement(ContactItem, { title: title, subtitle: subtitle, imageUrl: imageUrl, selected: selected }); } }; };