import React from "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]}`;
    }
};
export 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.createElement(React.Fragment, null,
            React.createElement("li", { className: type },
                React.createElement("strong", null,
                    type,
                    ":"),
                React.createElement("span", null,
                    type === "Age" || type === "Participants"
                        ? rangeDisplay(item.value)
                        : item.value,
                    React.createElement("span", { onClick: () => removeFilterItem(item.param, item.value) }, "\u00D7")))));
    }
};
