import React from 'react'; import PropTypes from 'prop-types'; import {ItemContainer} from 'apps/contacts/components'; import {ContactName, Notes, JobTitle} from 'apps/contacts/components/fields'; import {isEmpty, findKey} from 'lodash'; import {gettext} from 'core/utils'; /** * Media Contact Info - renders contact's information */ export const ContactInfo: React.StatelessComponent = ({item, labelInactive}) => { const meta = []; const info = []; const contactJobTitle = item.job_title ? : null; const contactOrg = item.first_name && item.organisation ? {item.organisation} : null; info.push(

{contactJobTitle && {contactJobTitle}}

{contactOrg} {!item.is_active && labelInactive && ( {gettext('Inactive')} )}
, ); meta.push(
  • {!isEmpty(item.contact_email) && ()}
  • , ); meta.push(
  • {item.website && ()}
  • , ); meta.push(
  • {!isEmpty(item.contact_phone) && findKey(item.contact_phone, 'number') && () }
  • , ); meta.push(
  • {!isEmpty(item.mobile) && findKey(item.mobile, 'number') && () }
  • , ); meta.push(
  • {item && ()}
  • , ); info.push(
      {meta}
    • {item.notes && ()}
    , ); return (
    {info}
    ); }; ContactInfo.propTypes = { item: PropTypes.object, labelInactive: PropTypes.bool, };