import { computed as f, resolveComponent as d, createBlock as i, openBlock as l, withCtx as a, renderSlot as n, createCommentVNode as c, createVNode as p, createTextVNode as s, toDisplayString as y } from "vue";
const k = {
  __name: "wt-page-header",
  props: {
    /**
     * Hides primary button
     * @type {boolean}
     * @default false
     */
    hidePrimary: {
      type: Boolean,
      default: !1
    },
    /**
     * Hides secondary button
     * @type {boolean}
     * @default false
     */
    hideSecondary: {
      type: Boolean,
      default: !1
    },
    /**
     * Text for primary button. If empty - the title "ADD"
     * @type {string}
     */
    primaryText: {
      type: String
    },
    /**
     * Primary button click handler
     * @type {Function}
     */
    primaryAction: {
      type: Function
    },
    /**
     * Disables primary button
     * @type {boolean}
     * @default false
     */
    primaryDisabled: {
      type: Boolean,
      default: !1
    },
    /**
     * Disables secondary button
     * @type {boolean}
     * @default false
     */
    secondaryDisabled: {
      type: Boolean,
      default: !1
    },
    /**
     * Text for secondary button. If empty - the title "CLOSE"
     * @type {string}
     */
    secondaryText: {
      type: String
    },
    /**
     * Secondary button click handler
     * @type {Function}
     */
    secondaryAction: {
      type: Function
    }
  },
  setup(e) {
    const o = e, u = f(
      () => !(o.secondaryAction || o.secondaryText)
    );
    return (t, b) => {
      const r = d("wt-button"), m = d("wt-headline");
      return l(), i(m, null, {
        "title-wrapper": a(() => [
          n(t.$slots, "default")
        ]),
        title: a(() => [
          n(t.$slots, "title")
        ]),
        actions: a(() => [
          n(t.$slots, "actions"),
          e.hidePrimary ? c("", !0) : n(t.$slots, "primary-action", { key: 0 }, () => [
            p(r, {
              disabled: e.primaryDisabled,
              onClick: e.primaryAction
            }, {
              default: a(() => [
                s(y(e.primaryText || t.$t("reusable.add")), 1)
              ], void 0, !0),
              _: 1
            }, 8, ["disabled", "onClick"])
          ]),
          !e.hideSecondary && !u.value ? (l(), i(r, {
            key: 1,
            disabled: e.secondaryDisabled,
            color: "secondary",
            onClick: e.secondaryAction
          }, {
            default: a(() => [
              s(y(e.secondaryText || t.$t("reusable.close")), 1)
            ], void 0, !0),
            _: 1
          }, 8, ["disabled", "onClick"])) : c("", !0)
        ]),
        _: 3
      });
    };
  }
};
export {
  k as default
};
