import * as React from 'react'; import {get} from 'lodash'; import {superdeskApi} from '../../../superdeskApi'; import {IListFieldProps} from '../../../interfaces'; export class ListFieldPlaces extends React.PureComponent { render() { const field = this.props.field ?? 'place'; const placeNames = (get(this.props.item, field) || []) .map((place) => place.name) .join(', '); if (placeNames.length > 0) { const {gettext} = superdeskApi.localization; return (
{gettext('Places:')} {placeNames}
); } return null; } }