import { Radio } from "../Radio.js";
import { Filter } from "./Filter.js";
import "./filters.js";
import { Fragment, jsx } from "@emotion/react/jsx-runtime";
//#region src/components/DataManagerTable/BooleanFilter.tsx
const isBooleanFilterState = (state) => state.type === "boolean";
const getDefaultBooleanFilterState = () => ({
	type: "boolean",
	value: void 0,
	isApplied: false
});
const BooleanFilter = ({ updateFilterState, state, label }) => {
	return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Filter, {
		label,
		children: /* @__PURE__ */ jsx(Radio, {
			radioOptions: [
				{ label: "Yes" },
				{ label: "No" },
				{ label: "Both" }
			],
			defaultOption: "Both",
			onChange: (selectedOption) => {
				updateFilterState({
					...state,
					value: selectedOption === "Yes" ? true : selectedOption === "No" ? false : void 0,
					isApplied: true
				});
			}
		})
	}) });
};
//#endregion
export { BooleanFilter, getDefaultBooleanFilterState, isBooleanFilterState };
