import SidebarListElementForm_default from "../../components/Sidebar/Actions/SidebarListElementForm.vue.js";
import EnvironmentColors_default from "./EnvironmentColors.vue.js";
import { createBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, unref, withCtx } from "vue";
import { ScalarModal } from "@scalar/components";
//#region src/views/Environment/EnvironmentColorModal.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "flex flex-col gap-4" };
var EnvironmentColorModal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "EnvironmentColorModal",
	props: {
		state: {},
		selectedColor: {}
	},
	emits: ["cancel", "submit"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const newColor = ref("");
		const handleColorSelect = (color) => {
			newColor.value = color;
		};
		const handleSubmit = () => {
			emit("submit", newColor.value);
			newColor.value = "";
		};
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ScalarModal), {
				size: "xxs",
				state: __props.state,
				title: "Edit Environment Color"
			}, {
				default: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(EnvironmentColors_default, {
					activeColor: newColor.value || props.selectedColor,
					class: "w-full p-1",
					onSelect: handleColorSelect
				}, null, 8, ["activeColor"]), createVNode(SidebarListElementForm_default, {
					onCancel: _cache[0] || (_cache[0] = ($event) => emit("cancel")),
					onSubmit: handleSubmit
				})])]),
				_: 1
			}, 8, ["state"]);
		};
	}
});
//#endregion
export { EnvironmentColorModal_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=EnvironmentColorModal.vue.script.js.map