import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import Filter from "../../../filter/components/FilterButton/index.js";
import withContainer from "../../utils/withContainer.js";
import React, { forwardRef, useEffect, useState } from "react";
import { Form } from "antd";
//#region src/components/pisellDataSourceContainer/components/Filter/FilterButton.tsx
const _excluded = [
	"serverActions",
	"value",
	"quickFilterMaxLength",
	"formFiltersPrefix",
	"hiddenQuickFilter",
	"hiddenOtherFilter"
];
var FilterButton_default = withContainer(forwardRef((props) => {
	const { serverActions, value: originalValue, quickFilterMaxLength, formFiltersPrefix, hiddenQuickFilter = true, hiddenOtherFilter = false } = props, otherProps = _objectWithoutProperties(props, _excluded);
	const [value, setValue] = useState({});
	useEffect(() => {
		setValue({
			quickFilter: (originalValue === null || originalValue === void 0 ? void 0 : originalValue.quickFilter) || [],
			otherFilter: (originalValue === null || originalValue === void 0 ? void 0 : originalValue.otherFilter) || []
		});
	}, [originalValue]);
	return /* @__PURE__ */ React.createElement(Form, _objectSpread2({
		size: "large",
		layout: "vertical",
		className: "filter-form-wrapper"
	}, otherProps), /* @__PURE__ */ React.createElement(Filter, {
		value: {
			quickFilter: value.quickFilter,
			otherFilter: value.otherFilter
		},
		hiddenQuickFilter,
		hiddenOtherFilter,
		onChange: setValue,
		quickFilterMaxLength: quickFilterMaxLength || 100,
		formFiltersPrefix: formFiltersPrefix || ""
	}));
}), "filterButton");
//#endregion
export { FilterButton_default as default };
