"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SynchronizationIssuesActivity = void 0;
var react_1 = __importDefault(require("react"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var ActivityTitle_1 = require("../../../ActivityTitle");
var EntityObject_1 = require("../../../EntityObject");
var ObjectLabel_1 = require("../ObjectLabel");
var styles_1 = require("./styles");
var SynchronizationIssuesActivity = function (_a) {
    var type = _a.type, data = _a.data;
    var styles = (0, styles_1.useStyles)();
    var description = (0, mdm_sdk_1.parseJSON)(data.description);
    var itemsTotal = data.itemsTotal;
    var objectUri = data.items[0].objectUri;
    return (react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "synchronization-issues-activity" },
        (0, mdm_sdk_1.isRelationUri)(objectUri) ? (react_1.default.createElement("span", { className: styles.relationUri }, objectUri)) : (react_1.default.createElement(EntityObject_1.EntityObject, { item: data.items[0] })),
        description && (react_1.default.createElement(ObjectLabel_1.ObjectLabel, { "data-reltio-id": "synchronization-issues-activity-description", label: description.label })),
        itemsTotal > 1 && (react_1.default.createElement(ObjectLabel_1.ObjectLabel, { "data-reltio-id": "synchronization-issues-activity-items-total", label: ui_i18n_1.default.text('(${itemsTotal} records)', { itemsTotal: itemsTotal }) }))));
};
exports.SynchronizationIssuesActivity = SynchronizationIssuesActivity;
