"use strict";
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 styledComponents_1 = require("./styledComponents");
var textComponents_1 = require("./textComponents");
var PhaseCountdown_1 = require("../PhaseCountdown/");
var TransactionButton_1 = require("../TransactionButton");
var Button_1 = require("../Button");
var ChallengePhaseDetail_1 = require("./ChallengePhaseDetail");
var ChallengeResultsChart_1 = require("../ChallengeResultsChart");
var NeedHelp_1 = __importDefault(require("./NeedHelp"));
var AppealDecisionDetail_1 = require("./AppealDecisionDetail");
exports.AppealDecisionCard = function (props) {
    var renderSubmitChallengeButton = function () {
        if (props.submitAppealChallengeURI) {
            return (React.createElement(React.Fragment, null,
                React.createElement(Button_1.Button, { size: Button_1.buttonSizes.MEDIUM, to: props.submitAppealChallengeURI }, "Submit a Challenge")));
        }
        return React.createElement(TransactionButton_1.TransactionButtonNoModal, { transactions: props.transactions }, "Submit a Challenge");
    };
    return (React.createElement(styledComponents_1.StyledListingDetailPhaseCardContainer, null,
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.StyledPhaseKicker, null,
                "Challenge ID ",
                props.challengeID),
            React.createElement(styledComponents_1.StyledPhaseDisplayName, null, "Appeal to Council"),
            React.createElement(PhaseCountdown_1.ProgressBarCountdownTimer, { endTime: props.endTime, totalSeconds: props.phaseLength, displayLabel: "Request to challenge Council's decision", toolTipText: React.createElement(textComponents_1.ChallangeCouncilToolTipText, { phaseLength: props.phaseLength }), flavorText: "under Appeal to Council" })),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(ChallengePhaseDetail_1.ChallengePhaseDetail, { challengeID: props.challengeID, challenger: props.challenger, isViewingUserChallenger: props.isViewingUserChallenger, rewardPool: props.rewardPool, stake: props.stake, dispensationPct: props.dispensationPct })),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(ChallengeResultsChart_1.ChallengeResults, { collapsable: true, totalVotes: props.totalVotes, votesFor: props.votesFor, votesAgainst: props.votesAgainst, percentFor: props.percentFor, percentAgainst: props.percentAgainst, didChallengeSucceed: props.didChallengeOriginallySucceed })),
        React.createElement(AppealDecisionDetail_1.AppealDecisionDetail, { appealGranted: props.appealGranted, appealGrantedStatementURI: props.appealGrantedStatementURI }),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.CTACopy, null, "If you believe this newsroom does not align with the Civil Constitution, you may challenge the Council\u2019s decision."),
            renderSubmitChallengeButton()),
        React.createElement(NeedHelp_1.default, { faqURL: props.faqURL })));
};
//# sourceMappingURL=AppealDecisionCard.js.map