import React from 'react'; import PropTypes from 'prop-types'; import {ItemContainer} from 'apps/contacts/components'; import {some, isEmpty} from 'lodash'; /** * ContactLocation - to display address/location of a contact item */ export const ContactLocation: React.StatelessComponent = ({item}) => { const ADDRESS_FIELDS = ['contact_address', 'locality', 'city', 'contact_state', 'postcode', 'country']; const canShow = some(ADDRESS_FIELDS, (field) => !isEmpty(item[field])); return (
{canShow && } { canShow && () }
); }; ContactLocation.propTypes = { item: PropTypes.object, };