'use client';

import { useCodeContext } from "./CodeContext.mjs";
import { Select } from "../Select/Select.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
import { useIntlayer } from "react-intlayer";

//#region src/components/IDE/CodeFormatSelector.tsx
const CodeFormatSelector = () => {
	const { codeFormat, setCodeFormat, setContentDeclarationFormat } = useCodeContext();
	const content = useIntlayer("code-selectors");
	return /* @__PURE__ */ jsxs(Select, {
		value: codeFormat,
		onValueChange: (value) => {
			setCodeFormat(value);
			setContentDeclarationFormat(value);
		},
		children: [/* @__PURE__ */ jsx(Select.Trigger, {
			className: "py-1!",
			"aria-label": content.codeFormat.label.value,
			children: /* @__PURE__ */ jsx(Select.Value, { placeholder: content.codeFormat.placeholder.value })
		}), /* @__PURE__ */ jsxs(Select.Content, { children: [
			/* @__PURE__ */ jsx(Select.Item, {
				value: "typescript",
				children: "TypeScript"
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: "esm",
				children: "ESM"
			}),
			/* @__PURE__ */ jsx(Select.Item, {
				value: "commonjs",
				children: "CommonJS"
			})
		] })]
	});
};

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