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