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