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