import { currentRoom as m, useProjects as f, openBlock as l, createElementBlock as s, createBaseVNode as r, withDirectives as x, vModelText as k, unref as e, newProject as n, createVNode as _, withCtx as h, Fragment as y, renderList as g, createBlock as v, normalizeStyle as b, TransitionGroup as j, addProject as C, toDisplayString as P, createCommentVNode as w } from "./composables-078fa750.js";
import { ProjectCard as B } from "./components.js";
const S = { class: "flex flex-col" }, V = { class: "p-2 flex flex-col gap-2" }, N = { class: "flex flex-col gap-4 p-2" }, $ = { class: "p-2 flex flex-col gap-2" };
var i;
const z = {
  __name: "ProjectList",
  props: {
    pub: { type: String, default: (i = m) == null ? void 0 : i.pub }
  },
  emits: ["open"],
  setup(a) {
    const c = a, { candidates: p } = f(c.pub);
    return (d, o) => (l(), s("div", S, [
      r("div", V, [
        x(r("input", {
          class: "p-2 rounded-xl shadow dark-bg-dark-400",
          "onUpdate:modelValue": o[0] || (o[0] = (t) => e(n).title = t),
          placeholder: "Start typing a project title"
        }, null, 512), [
          [k, e(n).title]
        ])
      ]),
      r("div", N, [
        _(j, { name: "list" }, {
          default: h(() => [
            (l(!0), s(y, null, g(e(p), (t, u) => (l(), v(e(B), {
              key: u,
              project: t.item,
              path: t.item.path,
              style: b({ opacity: 1 - t.score }),
              onClick: (D) => d.$emit("open", t.item.path)
            }, null, 8, ["project", "path", "style", "onClick"]))), 128))
          ]),
          _: 1
        })
      ]),
      r("div", $, [
        e(n).title ? (l(), s("button", {
          class: "button",
          key: "button",
          onClick: o[1] || (o[1] = (t) => e(C)())
        }, "Add Project " + P(e(n).title), 1)) : w("", !0)
      ])
    ]));
  }
};
export {
  z as default
};
//# sourceMappingURL=ProjectList-993a94b7.js.map
