'use client';

import { Select } from "../Select/Select.mjs";
import { useState } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
import { getNodeType } from "@intlayer/core";
import { useIntlayer } from "react-intlayer";
import { NodeType } from "@intlayer/types";

//#region src/components/DictionaryFieldEditor/NodeTypeSelector.tsx
const NodeTypeSelector = ({ section, onValueChange: onValueChangeProp }) => {
	const { multilingual, text, number, boolean, node, array, enumeration, triggerPlaceHolder, nest, gender, condition, markdown, insertion, reactNode, file } = useIntlayer("node-type-selector");
	const [keyType, setKeyType] = useState(getNodeType(section));
	const onValueChange = (keyType$1) => {
		setKeyType(keyType$1);
		onValueChangeProp(keyType$1);
	};
	return /* @__PURE__ */ jsxs(Select, {
		value: keyType,
		onValueChange,
		children: [/* @__PURE__ */ jsx(Select.Trigger, { children: /* @__PURE__ */ jsx(Select.Value, { placeholder: triggerPlaceHolder }) }), /* @__PURE__ */ jsxs(Select.Content, { children: [
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Translation,
				children: multilingual
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Text,
				children: text
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Number,
				children: number
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Boolean,
				children: boolean
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Object,
				children: node
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Array,
				children: array
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Enumeration,
				children: enumeration
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Gender,
				children: gender
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Insertion,
				children: insertion
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Markdown,
				children: markdown
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Nested,
				children: nest
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.Condition,
				children: condition
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.ReactNode,
				disabled: true,
				children: reactNode
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: NodeType.File,
				children: file
			})
		] })]
	});
};

//#endregion
export { NodeTypeSelector };
//# sourceMappingURL=NodeTypeSelector.mjs.map