import { defineComponent, unref, withCtx, createVNode, withModifiers, withDirectives, vModelText, useSSRContext } from "vue";
import { ssrRenderComponent, ssrRenderAttr, ssrInterpolate } from "vue/server-renderer";
import { useForm, Head } from "@inertiajs/vue3";
import { _ as _sfc_main$1 } from "./AppLayout-DXKl-uoF.js";
import "class-variance-authority";
import "./AppLogoIcon-DhmQfNIw.js";
import "clsx";
import "tailwind-merge";
import "reka-ui";
import "@vueuse/core";
import "lucide-vue-next";
import "./Input-CFG4Vy8n.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Rate",
  __ssrInlineRender: true,
  props: ["request"],
  setup(__props) {
    const breadcrumbs = [
      {
        title: "Статистика монтажников",
        href: "/installers/stats"
      }
    ];
    const props = __props;
    const form = useForm({
      rating: 5,
      comment: ""
    });
    const submit = () => {
      form.post(`/requests/${props.request.id}/rate`);
    };
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<!--[-->`);
      _push(ssrRenderComponent(unref(Head), { title: "Заявки на монтаж" }, null, _parent));
      _push(ssrRenderComponent(_sfc_main$1, { breadcrumbs }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`<div class="flex h-full flex-1 flex-col gap-4 rounded-xl p-4"${_scopeId}><div class="max-w-lg mx-auto p-4"${_scopeId}><h2 class="text-xl font-bold mb-4"${_scopeId}>Оценка монтажника</h2><form class="space-y-4"${_scopeId}><div${_scopeId}><label${_scopeId}>Оценка (1-5)</label><input type="number" min="1" max="5" step="0.5"${ssrRenderAttr("value", unref(form).rating)} class="w-full border rounded p-2"${_scopeId}></div><div${_scopeId}><label${_scopeId}>Комментарий</label><textarea class="w-full border rounded p-2"${_scopeId}>${ssrInterpolate(unref(form).comment)}</textarea></div><button type="submit" class="bg-green-600 text-white px-4 py-2 rounded"${_scopeId}>Оценить</button></form></div></div>`);
          } else {
            return [
              createVNode("div", { class: "flex h-full flex-1 flex-col gap-4 rounded-xl p-4" }, [
                createVNode("div", { class: "max-w-lg mx-auto p-4" }, [
                  createVNode("h2", { class: "text-xl font-bold mb-4" }, "Оценка монтажника"),
                  createVNode("form", {
                    onSubmit: withModifiers(submit, ["prevent"]),
                    class: "space-y-4"
                  }, [
                    createVNode("div", null, [
                      createVNode("label", null, "Оценка (1-5)"),
                      withDirectives(createVNode("input", {
                        type: "number",
                        min: "1",
                        max: "5",
                        step: "0.5",
                        "onUpdate:modelValue": ($event) => unref(form).rating = $event,
                        class: "w-full border rounded p-2"
                      }, null, 8, ["onUpdate:modelValue"]), [
                        [vModelText, unref(form).rating]
                      ])
                    ]),
                    createVNode("div", null, [
                      createVNode("label", null, "Комментарий"),
                      withDirectives(createVNode("textarea", {
                        "onUpdate:modelValue": ($event) => unref(form).comment = $event,
                        class: "w-full border rounded p-2"
                      }, null, 8, ["onUpdate:modelValue"]), [
                        [vModelText, unref(form).comment]
                      ])
                    ]),
                    createVNode("button", {
                      type: "submit",
                      class: "bg-green-600 text-white px-4 py-2 rounded"
                    }, "Оценить")
                  ], 32)
                ])
              ])
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<!--]-->`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("resources/js/pages/requests/Rate.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
