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 React, { forwardRef, useMemo } from "react";
import { Select } from "antd";
import classNames from "classnames";
//#region src/components/pisellSingleSelect/components/DisabledView.tsx
/**
* PisellSingleSelect - DisabledView (禁用态视图)
* 禁用状态下的渲染
*/
const _excluded = [
	"value",
	"options",
	"label",
	"required",
	"placeholder",
	"size",
	"className",
	"style"
];
const DisabledView = forwardRef((props, ref) => {
	const { value, options, label, required, placeholder = "请选择", size = "middle", className, style } = props, restProps = _objectWithoutProperties(props, _excluded);
	const antdOptions = useMemo(() => options.map((opt) => ({
		label: opt.label,
		value: opt.value,
		disabled: opt.disabled
	})), [options]);
	return /* @__PURE__ */ React.createElement("div", {
		className: classNames("pisell-single-select-wrapper", className),
		style
	}, label && /* @__PURE__ */ React.createElement("label", { className: classNames("pisell-single-select-label", { "pisell-single-select-label-required": required }) }, label), /* @__PURE__ */ React.createElement(Select, _objectSpread2(_objectSpread2({}, restProps), {}, {
		ref,
		value: value !== null && value !== void 0 ? value : void 0,
		options: antdOptions,
		placeholder,
		disabled: true,
		size,
		className: "pisell-single-select"
	})));
});
DisabledView.displayName = "PisellSingleSelectDisabledView";
//#endregion
export { DisabledView as default };
