'use strict';

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

exports.default = configContext => data => {
  var _configContext$record = configContext.recordDataHelpers;
  const getPart = _configContext$record.getPart,
        deepGet = _configContext$record.deepGet;
  const getDisplayName = configContext.refNameHelpers.getDisplayName;


  if (!data) {
    return '';
  }

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

  if (!common) {
    return '';
  }

  const conservationNumber = common.get('conservationNumber');
  const status = getDisplayName(deepGet(common, ['conservationStatusGroupList', 'conservationStatusGroup', 0, 'status']));

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