import { _ as __nuxt_component_0$1 } from './nuxt-link-Cq8xZgFP.mjs';
import { defineComponent, computed, mergeProps, unref, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderClass } from 'vue/server-renderer';
import { _ as _export_sfc, j as useRoute } from './server.mjs';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "IssueHeader",
  __ssrInlineRender: true,
  props: {
    issue: {},
    activeTab: {}
  },
  setup(__props) {
    const props = __props;
    const route = useRoute();
    const backLink = computed(() => {
      const path = route.path;
      if (path.match(/\/issue\/[^/]+\/history\/[^/]+\/(terminal|prompt)$/)) {
        return {
          to: `/issue/${props.issue?.id}/history`,
          label: "issue.history"
        };
      }
      return {
        to: "/kanban",
        label: "nav.kanban"
      };
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_NuxtLink = __nuxt_component_0$1;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "issue-header" }, _attrs))} data-v-242cda85><div class="issue-info" data-v-242cda85>`);
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: unref(backLink).to,
        class: "back-link"
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(` ← ${ssrInterpolate(_ctx.$t(unref(backLink).label))}`);
          } else {
            return [
              createTextVNode(" ← " + toDisplayString(_ctx.$t(unref(backLink).label)), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<h1 class="issue-title" data-v-242cda85><span class="issue-id" data-v-242cda85>${ssrInterpolate(__props.issue?.id)}</span> ${ssrInterpolate(__props.issue?.title)}</h1><div class="issue-meta" data-v-242cda85>`);
      if (__props.issue?.priority) {
        _push(`<span class="${ssrRenderClass([`badge-${__props.issue.priority}`, "badge"])}" data-v-242cda85>${ssrInterpolate(__props.issue.priority)}</span>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<span class="column-name" data-v-242cda85>${ssrInterpolate(__props.issue?.column)}</span></div></div><nav class="issue-tabs" data-v-242cda85>`);
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: `/issue/${__props.issue?.id}`,
        class: ["tab", { active: __props.activeTab === "details" }]
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("issue.details"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("issue.details")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: `/issue/${__props.issue?.id}/comments`,
        class: ["tab", { active: __props.activeTab === "comments" }]
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("issue.comments"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("issue.comments")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: `/issue/${__props.issue?.id}/history`,
        class: ["tab", { active: __props.activeTab === "history" }]
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("issue.history"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("issue.history")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: `/issue/${__props.issue?.id}/terminal`,
        class: ["tab", { active: __props.activeTab === "terminal" }]
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(_ctx.$t("issue.terminal"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(_ctx.$t("issue.terminal")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</nav></div>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/IssueHeader.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const __nuxt_component_0 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main, [["__scopeId", "data-v-242cda85"]]), { __name: "IssueHeader" });

export { __nuxt_component_0 as _ };
//# sourceMappingURL=IssueHeader-BKlqeUoH.mjs.map
