import { defineComponent as d, ref as p, createElementBlock as n, unref as l, openBlock as r, withDirectives as f, createCommentVNode as v, createElementVNode as u, withKeys as b, withModifiers as x, vModelText as c } from "vue";
import { useUser as k } from "./composables-BAZQlC3e.js";
const g = {
  key: 0,
  class: "flex gap-2"
}, y = {
  key: 1,
  class: "p-4 flex flex-col items-center"
}, B = /* @__PURE__ */ d({
  __name: "ChatInput",
  emits: ["submit"],
  setup(C, { emit: m }) {
    const { user: s } = k(), a = m, t = p("");
    function i() {
      a("submit", t.value), t.value = "";
    }
    return (w, e) => l(s).pub ? (r(), n("div", g, [
      f(u("textarea", {
        class: "p-2 rounded-xl bg-light-200 flex-1 dark-bg-dark-200",
        "onUpdate:modelValue": e[0] || (e[0] = (o) => t.value = o),
        placeholder: "Your message",
        onKeydown: e[1] || (e[1] = b(x((o) => i(), ["prevent", "stop"]), ["enter"]))
      }, null, 544), [
        [c, t.value]
      ]),
      l(s).pub ? (r(), n("button", {
        key: 0,
        class: "button",
        onClick: e[2] || (e[2] = (o) => i())
      }, e[4] || (e[4] = [
        u("div", { class: "i-la-comment-dots mx-2" }, null, -1)
      ]))) : v("", !0)
    ])) : (r(), n("div", y, [
      u("button", {
        class: "button",
        onClick: e[3] || (e[3] = (o) => l(s).auth = !0)
      }, "Log in to post messages")
    ]));
  }
});
export {
  B as default
};
//# sourceMappingURL=ChatInput-B5c8rpG4.js.map
