import { defineComponent as C, computed as d, ref as P, resolveComponent as _, openBlock as e, createElementBlock as o, createElementVNode as c, toDisplayString as S, unref as s, createVNode as r, Transition as N, withCtx as f, TransitionGroup as T, Fragment as U, renderList as V, createCommentVNode as m } from "vue";
import { useUser as B, useUserPosts as E, reactToPost as L } from "./composables-5f691338.js";
const M = { class: "flex flex-col" }, R = { class: "text-xl font-bold mb-2" }, $ = { class: "flex flex-col gap-4" }, w = {
  key: 0,
  class: "flex flex-col bg-light-800 dark-bg-dark-200 rounded-2xl gap-4"
}, z = ["onClick"], A = /* @__PURE__ */ c("div", { class: "i-la-trash" }, null, -1), D = [
  A
], q = /* @__PURE__ */ C({
  __name: "AccountReactions",
  props: {
    pub: {
      default: "",
      type: String
    }
  },
  emits: ["post"],
  setup(v, { emit: x }) {
    const l = v, { user: b } = B(), i = d(() => l.pub == b.pub), t = P(), u = E(l.pub), k = d(() => u[t.value] || []);
    return (F, p) => {
      const g = _("post-reaction-tabs"), h = _("post-card");
      return e(), o("div", M, [
        c("div", R, S(s(i) ? "My " : "") + " Posts", 1),
        c("div", $, [
          r(g, {
            current: t.value,
            "onUpdate:current": p[0] || (p[0] = (a) => t.value = a),
            reactions: s(u)
          }, null, 8, ["current", "reactions"]),
          r(N, { name: "fade" }, {
            default: f(() => [
              t.value ? (e(), o("div", w, [
                r(T, { name: "fade" }, {
                  default: f(() => [
                    (e(!0), o(U, null, V(s(k), (a, n) => (e(), o("div", {
                      class: "p-0 relative",
                      key: n
                    }, [
                      s(i) ? (e(), o("div", {
                        key: 0,
                        class: "absolute top-2 left-2 button p-2 z-100 text-2xl opacity-30 hover-opacity-100 transition cursor-pointer",
                        onClick: (y) => s(L)({ tag: a, hash: String(n), reaction: t.value, back: !1 })
                      }, D, 8, z)) : m("", !0),
                      r(h, {
                        style: { flex: "1 1 100px" },
                        hash: String(n),
                        actions: !1,
                        onClick: (y) => x("post", n)
                      }, null, 8, ["hash", "onClick"])
                    ]))), 128))
                  ]),
                  _: 1
                })
              ])) : m("", !0)
            ]),
            _: 1
          })
        ])
      ]);
    };
  }
});
export {
  q as default
};
//# sourceMappingURL=AccountReactions-b5674dee.js.map
