'use strict';

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

// Just a test comment.  Please remove this comment.
exports.default = function (pluginContext) {
  return function (cspaceDocument) {
    var _pluginContext$record = pluginContext.recordDataHelpers,
        deepGet = _pluginContext$record.deepGet,
        getPart = _pluginContext$record.getPart;


    if (!cspaceDocument) {
      return '';
    }

    var common = getPart(cspaceDocument, 'taxon_common');

    if (!common) {
      return '';
    }

    var displayName = deepGet(common, ['taxonTermGroupList', 'taxonTermGroup', 0, 'termDisplayName']);
    var termStatus = deepGet(common, ['taxonTermGroupList', 'taxonTermGroup', 0, 'termStatus']);

    return [displayName, termStatus].filter(function (part) {
      return !!part;
    }).join(' – ');
  };
};