'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, 'groups_common');

  if (!common) {
    return '';
  }

  const title = common.get('title');
  const owner = getDisplayName(common.get('owner'));

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