"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var icons_1 = require("../icons");
var styledComponents_1 = require("./styledComponents");
var ListingSummaryBase_1 = __importDefault(require("./ListingSummaryBase"));
var ChallengeOrAppealStatementSummary_1 = __importDefault(require("./ChallengeOrAppealStatementSummary"));
var NewsroomInfo_1 = __importDefault(require("./NewsroomInfo"));
var SummaryActionButton_1 = __importDefault(require("./SummaryActionButton"));
exports.ListingSummaryComponent = function (props) {
    var challengeID = props.challengeID, challengeStatementSummary = props.challengeStatementSummary, appealStatementSummary = props.appealStatementSummary;
    var renderAppealJudgement = function () {
        var appeal = props.appeal, didChallengeOriginallySucceed = props.didChallengeOriginallySucceed;
        if (!appeal || !appeal.appealGranted) {
            return React.createElement(React.Fragment, null);
        }
        var decisionText;
        // Challenge succeeded (newsroom rejected) and appeal was granted, so newsroom is accepted
        if (didChallengeOriginallySucceed) {
            decisionText = (React.createElement(React.Fragment, null,
                React.createElement(icons_1.HollowGreenCheck, null),
                " Appeal granted to accept Newsroom"));
            // Challenge failed (newsroom accepted) and appeal was granted, so newsroom is rejected
        }
        else {
            decisionText = (React.createElement(React.Fragment, null,
                React.createElement(icons_1.HollowRedNoGood, null),
                " Appeal granted to reject Newsroom"));
        }
        return React.createElement(styledComponents_1.StyledAppealJudgementContainer, null, decisionText);
    };
    return (React.createElement(ListingSummaryBase_1.default, __assign({}, props),
        React.createElement(styledComponents_1.StyledListingSummary, { hasTopPadding: true },
            renderAppealJudgement(),
            React.createElement(NewsroomInfo_1.default, __assign({}, props)),
            React.createElement(styledComponents_1.StyledListingSummarySection, null,
                React.createElement(ChallengeOrAppealStatementSummary_1.default, { challengeID: challengeID, challengeStatementSummary: challengeStatementSummary, appealStatementSummary: appealStatementSummary }),
                React.createElement(SummaryActionButton_1.default, __assign({}, props))))));
};
//# sourceMappingURL=ListingSummary.js.map