"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 react_router_dom_1 = require("react-router-dom");
var utils_1 = require("@joincivil/utils");
var styledComponents_1 = require("./styledComponents");
var textComponents_1 = require("./textComponents");
var Button_1 = require("../Button");
var TransactionButton_1 = require("../TransactionButton");
var QuestionToolTip_1 = require("../QuestionToolTip");
var NeedHelp_1 = __importDefault(require("./NeedHelp"));
exports.WhitelistedCard = function (props) {
    var displayDateTime;
    if (props.whitelistedTimestamp) {
        var listingRemovedDateTime = utils_1.getLocalDateTimeStrings(props.whitelistedTimestamp);
        displayDateTime = listingRemovedDateTime[0] + " " + listingRemovedDateTime[1];
    }
    return (React.createElement(styledComponents_1.StyledListingDetailPhaseCardContainer, null,
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.StyledPhaseDisplayName, null,
                React.createElement(textComponents_1.WhitelistedNewroomsDisplayNameText, null),
                React.createElement(QuestionToolTip_1.QuestionToolTip, { explainerText: React.createElement(textComponents_1.WhitelistedNewroomsToolTipText, null), positionBottom: true })),
            React.createElement(styledComponents_1.MetaItemLabel, null, "Approved date"),
            React.createElement(styledComponents_1.MetaItemValue, null, displayDateTime)),
        React.createElement(styledComponents_1.StyledListingDetailPhaseCardSection, null,
            React.createElement(styledComponents_1.CTACopy, null,
                "If you believe this newsroom does not align with the ",
                React.createElement("a", { href: props.constitutionURI }, "Civil Constitution"),
                ", you may ",
                React.createElement(react_router_dom_1.Link, { to: props.submitChallengeURI || "#" }, "submit a challenge"),
                "."),
            renderSubmitChallengeButton(props)),
        React.createElement(NeedHelp_1.default, { faqURL: props.faqURL })));
};
var renderSubmitChallengeButton = function (props) {
    if (props.submitChallengeURI) {
        return (React.createElement(React.Fragment, null,
            React.createElement(Button_1.InvertedButton, { size: Button_1.buttonSizes.MEDIUM, to: props.submitChallengeURI }, "Submit a Challenge")));
    }
    return React.createElement(TransactionButton_1.TransactionInvertedButton, { transactions: props.transactions }, "Submit a Challenge");
};
//# sourceMappingURL=WhitelistedCard.js.map