'use strict';

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

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


    if (!data) {
      return '';
    }

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

    if (!common) {
      return '';
    }

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

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