"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 utils_1 = require("@joincivil/utils");
var styledComponents_1 = require("./styledComponents");
var textComponents_1 = require("./textComponents");
var TransactionButton_1 = require("../TransactionButton");
var PhaseCountdown_1 = require("../PhaseCountdown/");
var ChallengeResultsChart_1 = require("../ChallengeResultsChart");
var ChallengePhaseDetail_1 = require("./ChallengePhaseDetail");
var NeedHelp_1 = __importDefault(require("./NeedHelp"));
var input_1 = require("../input");
var GrantAppealButton = function (props) {
    var text = "Grant Appeal";
    if (props.txIdToConfirm) {
        text = "Confirm Appeal";
    }
    return (React.createElement("div", null,
        !props.txIdToConfirm && React.createElement(input_1.TextInput, { name: "uri", value: props.uriValue, onChange: props.onChange }),
        React.createElement(TransactionButton_1.TransactionButtonNoModal, { transactions: props.transactions }, text)));
};
exports.AppealAwaitingDecisionCard = function (props) {
    var localDateTime = utils_1.getLocalDateTimeStrings(props.endTime);
    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: "Waiting for Council's decision", toolTipText: React.createElement(textComponents_1.WaitingCouncilDecisionToolTipText, { 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(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.MetaRow, null,
                React.createElement(styledComponents_1.MetaItem, null,
                    React.createElement(styledComponents_1.MetaItemLabel, null, "Requester"),
                    React.createElement(styledComponents_1.MetaItemValueLong, null, props.requester))),
            React.createElement(styledComponents_1.MetaRow, null,
                React.createElement(styledComponents_1.MetaItem, null,
                    React.createElement(styledComponents_1.MetaItemLabel, null, "Appeal Fee Paid"),
                    React.createElement(styledComponents_1.MetaItemValue, null, props.appealFeePaid)))),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.CTACopy, null,
                "Check back on ",
                localDateTime[0],
                " for Civil Council\u2019s decision to reject or grant the appeal. Read more for details of this appeal."),
            props.transactions && React.createElement(GrantAppealButton, __assign({}, props))),
        React.createElement(NeedHelp_1.default, { faqURL: props.faqURL })));
};
//# sourceMappingURL=AppealAwaitingDecisionCard.js.map