"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 __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
var pro_regular_svg_icons_1 = require("@fortawesome/pro-regular-svg-icons");
var Box_1 = __importDefault(require("@mui/material/Box"));
var ThumbChip_styles_1 = require("./ThumbChip.styles");
function Thumbs(_a) {
    var value = _a.value, setValue = _a.setValue;
    var upVote = function () {
        if (value === true) {
            setValue(null);
        }
        else {
            setValue(true);
        }
    };
    var downVote = function () {
        if (value === false) {
            setValue(null);
        }
        else {
            setValue(false);
        }
    };
    return (react_1.default.createElement(Box_1.default, { mr: 0.5, my: 0.5 },
        react_1.default.createElement(ThumbChip_styles_1.Button, { size: "small", onClick: downVote, selected: value === false, sentiment: "down" },
            react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: value === false ? free_solid_svg_icons_1.faThumbsDown : pro_regular_svg_icons_1.faThumbsDown })),
        react_1.default.createElement(ThumbChip_styles_1.Button, { size: "small", onClick: upVote, selected: value === true, sentiment: "up" },
            react_1.default.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: value === true ? free_solid_svg_icons_1.faThumbsUp : pro_regular_svg_icons_1.faThumbsUp }))));
}
function ThumbChip(_a) {
    var value = _a.value, setValue = _a.setValue, props = __rest(_a, ["value", "setValue"]);
    var color = value === null ? "none" : value ? "yes" : "red";
    return (react_1.default.createElement(ThumbChip_styles_1.Chip, __assign({ clickable: false, color: color, deleteIcon: react_1.default.createElement(Thumbs, { value: value, setValue: setValue }), onDelete: function () { } }, props)));
}
exports.default = ThumbChip;
//# sourceMappingURL=ThumbChip.js.map