import { friendlyName, isField, } from '../../../../../types/field';
import { formatItemValue } from '../../../../../utils/formatting';
export const formatPivotValueLabel = (pivotReference, fieldsMap) => {
    if (!pivotReference.pivotValues?.[0]) {
        return '';
    }
    const pivotFieldId = pivotReference.pivotValues[0].field;
    const pivotField = fieldsMap[pivotFieldId];
    const pivotValue = pivotReference.pivotValues[0].value;
    if (pivotField && isField(pivotField)) {
        return formatItemValue(pivotField, pivotValue, false, undefined);
    }
    return friendlyName(String(pivotValue));
};
//# sourceMappingURL=formatPivotValueLabel.js.map