import { h } from 'vue';
import { e as __nuxt_component_0$1 } from './server.mjs';

function buildDomainEntityNav(path, items, options) {
  const lastIndex = path.lastIndexOf("/");
  const basePath = path.substring(0, lastIndex);
  options = options || {};
  const clazz = [
    "nav nav-pills"
  ];
  switch (options.direction) {
    case "vertical":
      clazz.push("flex-column");
      break;
  }
  let prevLink = [];
  if (options.prevLink) {
    prevLink = h("li", { class: "nav-item" }, [
      h(
        __nuxt_component_0$1,
        {
          class: "nav-link",
          to: basePath
        },
        {
          default: () => [
            h("i", { class: "fa fa-arrow-left" })
          ]
        }
      )
    ]);
  }
  const buildLink = (link) => {
    if (link.length === 0) {
      return path;
    }
    if (link.substring(0, 1) === "/") {
      return `${path}${link}`;
    }
    return `${path}/${link}`;
  };
  return h(
    "ul",
    { class: clazz },
    [
      prevLink,
      ...items.map((item) => h("li", { class: "nav-item" }, [
        h(
          __nuxt_component_0$1,
          {
            class: "nav-link",
            to: buildLink(item.urlSuffix)
          },
          {
            default: () => [
              h("i", { class: `${item.icon} pe-1` }),
              item.name
            ]
          }
        )
      ]))
    ]
  );
}

export { buildDomainEntityNav as b };
//# sourceMappingURL=enity-nav.3b505301.mjs.map
