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