"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _formatHelpers = require("../../../helpers/formatHelpers");

var _default = configContext => (data, formatterContext) => {
  const {
    getPart
  } = configContext.recordDataHelpers;

  if (!data) {
    return '';
  }

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

  if (!common) {
    return '';
  }

  const valuationcontrolReferenceNumber = common.get('valuationcontrolRefNumber');
  const valueType = common.get('valueType');
  const formattedValueType = (0, _formatHelpers.formatOption)('valueTypes', valueType, formatterContext);
  return [valuationcontrolReferenceNumber, formattedValueType].filter(part => !!part).join(' – ');
};

exports.default = _default;