"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelationActivity = void 0;
var react_1 = __importDefault(require("react"));
var ActivityTitle_1 = require("../../../ActivityTitle");
var CollapsibleActivityRecords_1 = require("../../../CollapsibleActivityRecords");
var RelationRecord_1 = require("../../../RelationRecord");
var RelationObject_1 = require("../../../RelationObject");
var RelationActivity = function (_a) {
    var _b;
    var type = _a.type, data = _a.data;
    var isMinimized = data.itemsTotal === 1 && !((_b = data.items[0].deltaCollection) === null || _b === void 0 ? void 0 : _b.delta);
    return (react_1.default.createElement("div", { "data-reltio-id": "relation-activity" },
        react_1.default.createElement(ActivityTitle_1.ActivityTitle, { type: type, "data-reltio-id": "relation-activity-title" }, isMinimized && react_1.default.createElement(RelationObject_1.RelationObject, { item: data.items[0] })),
        !isMinimized && (react_1.default.createElement(CollapsibleActivityRecords_1.CollapsibleActivityRecords, { activityUri: data.uri, items: data.items, RecordComponent: RelationRecord_1.RelationRecord }))));
};
exports.RelationActivity = RelationActivity;
