@clayui/form
Version:
ClayForm component
15 lines (14 loc) • 699 B
JavaScript
import React from "react";
import Select from "./Select";
function ClaySelectWithOption({ options = [], ...otherProps }) {
return /* @__PURE__ */ React.createElement(Select, { ...otherProps }, options.map((option, index) => {
if (option.type === "group") {
return /* @__PURE__ */ React.createElement(Select.OptGroup, { key: index, label: option.label }, option.options && option.options.map((item, j) => /* @__PURE__ */ React.createElement(Select.Option, { ...item, key: j })));
}
return /* @__PURE__ */ React.createElement(Select.Option, { ...option, key: index });
}));
}
var SelectWithOption_default = ClaySelectWithOption;
export {
SelectWithOption_default as default
};