import { defineComponent as g, useUser as h, computed as p, ref as y, useUserPosts as C, openBlock as o, createElementBlock as s, createBaseVNode as l, toDisplayString as P, unref as t, createVNode as r, withCtx as f, TransitionGroup as S, Fragment as T, renderList as B, reactToPost as N, createCommentVNode as _, Transition as R } from "./composables-078fa750.js";
import { PostReactionTabs as U, PostCard as V } from "./components.js";
const L = { class: "flex flex-col" }, M = { 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__ */ l("div", { class: "i-la-trash" }, null, -1), D = [
  A
], j = /* @__PURE__ */ g({
  __name: "AccountReactions",
  props: {
    pub: {
      default: "",
      type: String
    }
  },
  emits: ["post"],
  setup(m, { emit: v }) {
    const c = m, { user: x } = h(), i = p(() => c.pub == x.pub), e = y(), u = C(c.pub), b = p(() => u[e.value] || []);
    return (E, d) => (o(), s("div", L, [
      l("div", M, P(t(i) ? "My " : "") + " Posts", 1),
      l("div", $, [
        r(t(U), {
          current: e.value,
          "onUpdate:current": d[0] || (d[0] = (a) => e.value = a),
          reactions: t(u)
        }, null, 8, ["current", "reactions"]),
        r(R, { name: "fade" }, {
          default: f(() => [
            e.value ? (o(), s("div", w, [
              r(S, { name: "fade" }, {
                default: f(() => [
                  (o(!0), s(T, null, B(t(b), (a, n) => (o(), s("div", {
                    class: "p-0 relative",
                    key: n
                  }, [
                    t(i) ? (o(), s("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: (k) => t(N)({ tag: a, hash: String(n), reaction: e.value, back: !1 })
                    }, D, 8, z)) : _("", !0),
                    r(t(V), {
                      style: { flex: "1 1 100px" },
                      hash: String(n),
                      actions: !1,
                      onClick: (k) => v("post", n)
                    }, null, 8, ["hash", "onClick"])
                  ]))), 128))
                ]),
                _: 1
              })
            ])) : _("", !0)
          ]),
          _: 1
        })
      ])
    ]));
  }
});
export {
  j as default
};
//# sourceMappingURL=AccountReactions-a7eb7a96.js.map
