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