import { defineComponent as m, computed as s, openBlock as n, createElementBlock as h, createElementVNode as e, renderSlot as p, createBlock as u, resolveDynamicComponent as _, mergeProps as f, withCtx as v, toDisplayString as x, createVNode as b } from "vue";
import g from "./Icon.js";
const k = { class: "stash-section-header" }, w = {
  class: "stash-section-header__content flex-wrap items-center justify-between px-6 py-3 md:flex",
  "data-test": "stash-section-header|content"
}, y = { "data-test": "stash-section-header|title" }, C = { class: "stash-section-header__action-label m-0 text-ice-900" }, E = { class: "stash-section-header__action-icon size-6 items-center rounded-full bg-ice-200 p-[2px] text-ice-900" }, S = /* @__PURE__ */ m({
  __name: "SectionHeader",
  props: {
    actionLabel: { default: "View All" },
    actionIcon: { default: "arrow-right" },
    to: { default: void 0 }
  },
  emits: ["actionEvent"],
  setup(a, { emit: i }) {
    const t = a, c = i, r = s(() => t.to ? "router-link" : "button"), l = s(() => t.to ? {
      to: t.to
    } : {});
    return (d, o) => (n(), h("div", k, [
      e("div", w, [
        e("div", y, [
          e("h2", null, [
            p(d.$slots, "default")
          ])
        ]),
        (n(), u(_(r.value), f(l.value, {
          "data-test": "stash-section-header|action",
          class: "stash-section-header__action flex items-center gap-3 max-md:pt-3",
          onClick: o[0] || (o[0] = () => {
            t.to || c("actionEvent");
          })
        }), {
          default: v(() => [
            e("span", C, x(t.actionLabel), 1),
            e("span", E, [
              b(g, {
                name: t.actionIcon,
                size: "dense"
              }, null, 8, ["name"])
            ])
          ]),
          _: 1
        }, 16))
      ]),
      o[1] || (o[1] = e("div", { class: "stash-section-header__divider h-px bg-ice-200" }, null, -1))
    ]));
  }
});
export {
  S as default
};
//# sourceMappingURL=SectionHeader.js.map
