"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var Button_1 = require("../Button");
exports.DashboardActivityItemCTAButton = function (props) {
    var listingDetailURL = props.listingDetailURL, inCommitPhase = props.inCommitPhase, inRevealPhase = props.inRevealPhase, canRequestAppeal = props.canRequestAppeal, canResolveChallenge = props.canResolveChallenge, isAwaitingAppealChallenge = props.isAwaitingAppealChallenge, canListingAppealBeResolved = props.canListingAppealBeResolved, isAppealChallengeInCommitStage = props.isAppealChallengeInCommitStage, isAppealChallengeInRevealStage = props.isAppealChallengeInRevealStage, canListingAppealChallengeBeResolved = props.canListingAppealChallengeBeResolved, didUserCommit = props.didUserCommit, didUserReveal = props.didUserReveal, canUserCollect = props.canUserCollect, canUserRescue = props.canUserRescue, onClick = props.onClick;
    var buttonText;
    if (inCommitPhase) {
        buttonText = "Change Vote";
    }
    else if (isAppealChallengeInCommitStage && didUserCommit) {
        buttonText = "Commit Vote";
    }
    else if ((!didUserReveal && inRevealPhase) || isAppealChallengeInRevealStage) {
        buttonText = "Reveal Vote";
    }
    else if (canRequestAppeal) {
        buttonText = "Request Appeal";
    }
    else if (canResolveChallenge || canListingAppealChallengeBeResolved) {
        buttonText = "Resolve";
    }
    else if (isAwaitingAppealChallenge) {
        buttonText = "Challenge Appeal";
    }
    else if (canListingAppealBeResolved) {
        buttonText = "Resolve";
    }
    else if (canUserCollect) {
        buttonText = "Claim Rewards";
    }
    else if (canUserRescue) {
        buttonText = "Rescue Tokens";
    }
    if ((!listingDetailURL && !onClick) || !buttonText) {
        return React.createElement(React.Fragment, null);
    }
    var actionProp = {};
    if (onClick) {
        actionProp = { onClick: onClick };
    }
    else if (listingDetailURL) {
        actionProp = { to: listingDetailURL };
    }
    return (React.createElement(Button_1.InvertedButton, __assign({}, actionProp, { size: Button_1.buttonSizes.SMALL }), buttonText));
};
//# sourceMappingURL=DashboardActivityItemCTAButton.js.map