import React from 'react';
import { ActivityTitle } from '../../../ActivityTitle';
import { CollapsibleActivityRecords } from '../../../CollapsibleActivityRecords';
import { SegmentObject } from '../../../SegmentObject';
import { SegmentRecord } from '../../../SegmentRecord';
export var SegmentActivity = 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.createElement("div", { "data-reltio-id": "segment-activity" },
        React.createElement(ActivityTitle, { type: type, "data-reltio-id": "segment-activity-title" }, isMinimized && React.createElement(SegmentObject, { item: data.items[0] })),
        !isMinimized && (React.createElement(CollapsibleActivityRecords, { activityUri: data.uri, items: data.items, RecordComponent: SegmentRecord }))));
};
