"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FilterListItem = void 0;
const react_1 = __importDefault(require("react"));
const rangeDisplay = (range) => {
    if (range[0] === null) {
        return `<= ${range[1]}`;
    }
    else if (range[1] === null) {
        return `>= ${range[0]}`;
    }
    else {
        return `${range[0]} - ${range[1]}`;
    }
};
const FilterListItem = ({ item, type, removeFilterItem = () => { }, }) => {
    if (item.value === "All" ||
        item.value === "All Public" ||
        item.value === "All Time" ||
        JSON.stringify(item.value) === JSON.stringify([null, null])) {
        return null;
    }
    else {
        return (react_1.default.createElement(react_1.default.Fragment, null,
            react_1.default.createElement("li", { className: type },
                react_1.default.createElement("strong", null,
                    type,
                    ":"),
                react_1.default.createElement("span", null,
                    type === "Age" || type === "Participants"
                        ? rangeDisplay(item.value)
                        : item.value,
                    react_1.default.createElement("span", { onClick: () => removeFilterItem(item.param, item.value) }, "\u00D7")))));
    }
};
exports.FilterListItem = FilterListItem;
