import React from "react";
export const FilterDateItem = ({ item, type, removeFilterItem = () => { }, }) => {
    const dateIsNull = JSON.stringify(item) === JSON.stringify([null, null]);
    const startDay = !dateIsNull && item[0].getDate();
    const endDay = !dateIsNull && item[1].getDate();
    const startMonth = !dateIsNull && item[0].getMonth() + 1;
    const endMonth = !dateIsNull && item[1].getMonth() + 1;
    const startYear = !dateIsNull && item[0].getFullYear();
    const endYear = !dateIsNull && item[1].getFullYear();
    if (dateIsNull) {
        return null;
    }
    else {
        return (React.createElement(React.Fragment, null,
            React.createElement("li", { className: type },
                React.createElement("strong", null,
                    type,
                    ":"),
                React.createElement("span", null,
                    startMonth,
                    "/",
                    startDay,
                    "/",
                    startYear,
                    " - ",
                    endMonth,
                    "/",
                    endDay,
                    "/",
                    endYear,
                    React.createElement("span", { onClick: () => removeFilterItem(item.param, item.value) }, "\u00D7")))));
    }
};
