@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
26 lines (25 loc) • 767 B
JavaScript
"use client";
import { jsx } from "react/jsx-runtime";
//#region packages/@mantine/core/src/components/NativeSelect/NativeSelectOption.tsx
function isGroup(input) {
return "group" in input;
}
function NativeSelectOption({ data }) {
if (isGroup(data)) {
const items = data.items.map((item) => /* @__PURE__ */ jsx(NativeSelectOption, { data: item }, item.value));
return /* @__PURE__ */ jsx("optgroup", {
label: data.group,
children: items
});
}
const { value, label, ...others } = data;
return /* @__PURE__ */ jsx("option", {
value: data.value,
...others,
children: data.label
});
}
NativeSelectOption.displayName = "@mantine/core/NativeSelectOption";
//#endregion
export { NativeSelectOption };
//# sourceMappingURL=NativeSelectOption.mjs.map