'use strict';

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

exports.default = function (pluginContext) {
  return function (cspaceDocument) {
    var getPart = pluginContext.recordDataHelpers.getPart;


    if (!cspaceDocument) {
      return '';
    }

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

    if (!common) {
      return '';
    }

    var exhibitionNumber = common.get('exhibitionNumber');
    var title = common.get('title');

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