"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 DashboardActivityItemTitle_1 = __importDefault(require("./DashboardActivityItemTitle"));
var DashboardStyledComponents_1 = require("./DashboardStyledComponents");
var ItemCheckbox = function (props) {
    var challengeID = props.appealChallengeID || props.challengeID;
    var handleChange = function (event) {
        props.toggleSelect(challengeID, event.target.checked, props.salt);
    };
    return React.createElement("input", { type: "checkbox", onChange: handleChange });
};
exports.DashboardActivitySelectableItem = function (props) {
    if (props.challengeID && props.appealChallengeID) {
        throw new Error("DashboardActivitySelectableItem: cannot have both challengeID and appealChallengeID props");
    }
    var challengeIDDisplay = "Challenge";
    if (props.challengeID) {
        challengeIDDisplay = "Challenge #" + props.challengeID;
    }
    else if (props.appealChallengeID) {
        challengeIDDisplay = "Appeal Challenge #" + props.appealChallengeID;
    }
    return (React.createElement(DashboardStyledComponents_1.StyledDashboardActivityItem, null,
        React.createElement(DashboardStyledComponents_1.StyledItemCheckboxContainer, null, props.toggleSelect && ItemCheckbox(props)),
        React.createElement(DashboardStyledComponents_1.StyledDashboardActivityItemDetails, null,
            React.createElement(DashboardStyledComponents_1.StyledChallengeIDKicker, null, challengeIDDisplay),
            React.createElement(DashboardActivityItemTitle_1.default, { title: props.title, viewDetailURL: props.viewDetailURL }),
            props.children),
        props.numTokens && React.createElement(DashboardStyledComponents_1.StyledNumTokensContainer, null,
            "+",
            props.numTokens)));
};
//# sourceMappingURL=DashboardActivitySelectableItem.js.map