"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DCREntityUriLink = void 0;
var react_1 = __importDefault(require("react"));
var ramda_1 = require("ramda");
var classnames_1 = __importDefault(require("classnames"));
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var EntityUriLink_1 = require("../../../EntityUriLink");
var dcr_1 = require("../helpers/dcr");
var DCREntityUriLink_module_css_1 = __importDefault(require("./DCREntityUriLink.module.css"));
var DCREntityUriLink = function (_a) {
    var entityInfo = _a.entityInfo, changes = _a.changes, dcrUri = _a.dcrUri, className = _a.className;
    var entityUri = (0, ramda_1.ifElse)((0, ramda_1.any)(dcr_1.isCreateEntityOperation), (0, ramda_1.always)((0, dcr_1.getEntityUriForChangeRequest)(dcrUri, entityInfo.uri)), (0, ramda_1.always)((0, mdm_sdk_1.getEntityUriForLink)(entityInfo)))((0, ramda_1.propOr)([], entityInfo.uri, changes));
    var screen = (0, ramda_1.ifElse)((0, ramda_1.any)(dcr_1.isCreateEntityOperation), (0, ramda_1.always)('dcrReview'), (0, ramda_1.always)('profile'))((0, ramda_1.propOr)([], entityInfo.uri, changes));
    return (react_1.default.createElement(EntityUriLink_1.EntityUriLink, { className: (0, classnames_1.default)(DCREntityUriLink_module_css_1.default.link, className), value: entityUri, screen: screen },
        react_1.default.createElement("div", { className: DCREntityUriLink_module_css_1.default.label }, (0, mdm_sdk_1.getLabel)(entityInfo.label))));
};
exports.DCREntityUriLink = DCREntityUriLink;
