'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = configContext => data => {
  const getPart = configContext.recordDataHelpers.getPart;
  const getDisplayName = configContext.refNameHelpers.getDisplayName;


  if (!data) {
    return '';
  }

  const common = getPart(data, 'intakes_common');

  if (!common) {
    return '';
  }

  const entryNumber = common.get('entryNumber');
  const currentOwner = getDisplayName(common.get('currentOwner'));

  return [entryNumber, currentOwner].filter(part => !!part).join(' – ');
};