import { defineComponent as d, ref as m, unref as n, openBlock as l, createElementBlock as r, withDirectives as p, createElementVNode as u, withKeys as c, withModifiers as f, vModelText as v, createCommentVNode as b } from "vue";
import { useUser as x } from "./composables-5f691338.js";
const k = {
  key: 0,
  class: "flex gap-2"
}, g = /* @__PURE__ */ u("div", { class: "i-la-comment-dots mx-2" }, null, -1), _ = [
  g
], y = {
  key: 1,
  class: "p-4 flex flex-col items-center"
}, $ = /* @__PURE__ */ d({
  __name: "ChatInput",
  emits: ["submit"],
  setup(C, { emit: a }) {
    const { user: s } = x(), t = m("");
    function i() {
      a("submit", t.value), t.value = "";
    }
    return (h, e) => n(s).pub ? (l(), r("div", k, [
      p(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] = c(f((o) => i(), ["prevent", "stop"]), ["enter"]))
      }, null, 544), [
        [v, t.value]
      ]),
      n(s).pub ? (l(), r("button", {
        key: 0,
        class: "button",
        onClick: e[2] || (e[2] = (o) => i())
      }, _)) : b("", !0)
    ])) : (l(), r("div", y, [
      u("button", {
        class: "button",
        onClick: e[3] || (e[3] = (o) => n(s).auth = !0)
      }, "Log in to post messages")
    ]));
  }
});
export {
  $ as default
};
//# sourceMappingURL=ChatInput-094f3e00.js.map
