import Dropdown from "../Dropdown/Dropdown";
import FieldType from "../Types/FieldType";
import React from "react";
const BooleanFilter = (props) => {
    const filter = props.filter;
    const filterData = Object.assign({}, props.filterData);
    if (filter.type === FieldType.Boolean) {
        return (React.createElement(Dropdown, { options: [
                {
                    value: true,
                    label: "Yes",
                },
                {
                    value: false,
                    label: "No",
                },
            ], onChange: (value) => {
                if (!filter.key) {
                    return;
                }
                if (value === null) {
                    delete filterData[filter.key];
                }
                else {
                    filterData[filter.key] = value;
                }
                if (props.onFilterChanged) {
                    props.onFilterChanged(filterData);
                }
            }, placeholder: `Filter by ${filter.title}`, className: "relative rounded-md w-full overflow-visible" }));
    }
    return React.createElement(React.Fragment, null);
};
export default BooleanFilter;
//# sourceMappingURL=BooleanFilter.js.map