"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const components_1 = require("../../../themes/components");
const react_1 = __importStar(require("react"));
const borderRadius_1 = __importDefault(require("../../../themes/foundations/borderRadius"));
const styled_components_1 = require("styled-components");
const react_native_user_avatar_1 = __importDefault(require("react-native-user-avatar"));
function PollOptionView({ option, index, active, selfId, onChange, }) {
    const { colors } = react_1.useContext(styled_components_1.ThemeContext);
    const selfVote = option.votes.find((v) => v.id === selfId);
    return (react_1.default.createElement(components_1.Box, { bg: selfVote ? 'primary.500' : 'secondary.700', borderRadius: borderRadius_1.default.medium, p: 6 },
        react_1.default.createElement(components_1.HStack, { px: 1, align: "center", mr: 6 },
            react_1.default.createElement(components_1.CheckBox, { style: {
                    paddingRight: 10, height: 30, justifyContent: 'center', borderRadius: borderRadius_1.default.small,
                }, checkedCheckBoxColor: "white", uncheckedCheckBoxColor: "white", isChecked: !!selfVote, onClick: onChange }),
            react_1.default.createElement(components_1.Text, { textAlign: "center" }, option.text),
            option.count !== null && react_1.default.createElement(components_1.Text, null, `(${option.count})`)),
        react_1.default.createElement(components_1.HStack, { mt: 1 }, option.votes.map((vote, index) => (react_1.default.createElement(components_1.Tooltip, { label: vote.name },
            react_1.default.createElement(react_native_user_avatar_1.default, { style: { marginRight: 5, marginTop: 5, marginBottom: 5 }, bgColor: selfVote ? colors.secondary['700'] : colors.primary['500'], color: colors.textPrimary['100'], name: vote.name })))))));
}
exports.default = PollOptionView;
//# sourceMappingURL=PollsOptions.js.map