const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_objectWithoutProperties = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js");
const require_model = require("../../info/model.js");
const require_useSelectPet = require("../../info/service2/hooks/useSelectPet.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
//#region src/components/booking/materiels/holder/index.tsx
const _excluded = ["selectProps"];
const Holder = (props) => {
	var _state$pet;
	const { selectProps } = props, resetProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
	const { state } = (0, react.useContext)(require_model.Context);
	const { holderLists } = require_useSelectPet.default(state);
	/**
	* @title: holders数据
	* @description:
	* @param {*} useMemo
	* @return {*}
	* @Author: WangHan
	* @Date: 2024-12-02 22:30
	*/
	const holders = (0, react.useMemo)(() => {
		const lists = holderLists === null || holderLists === void 0 ? void 0 : holderLists.filter((d) => ((d === null || d === void 0 ? void 0 : d.id) || (d === null || d === void 0 ? void 0 : d.form_record_id)) > 0);
		if (!(lists === null || lists === void 0 ? void 0 : lists.length)) return [];
		return lists.map((d) => {
			return {
				value: (d === null || d === void 0 ? void 0 : d.id) || (d === null || d === void 0 ? void 0 : d.form_record_id),
				label: d === null || d === void 0 ? void 0 : d.main_field
			};
		});
	}, [state === null || state === void 0 || (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value]);
	const renderOptions = (0, react.useCallback)((array, value = "value", label = "label") => {
		return array.map((d) => {
			return /* @__PURE__ */ react.default.createElement(antd.Select.Option, {
				value: d[value],
				key: d[value],
				disabled: d.disabled
			}, d[label]);
		});
	}, []);
	return /* @__PURE__ */ react.default.createElement(antd.Select, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, selectProps), resetProps), renderOptions(holders));
};
//#endregion
exports.default = Holder;
