import { defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, renderSlot, createVNode, unref, createTextVNode } from 'vue';
import { MeSvgIcon } from '../../svg-icon/index.mjs';
import { useRouter } from 'vue-router';

"use strict";
const _hoisted_1 = { class: "me-page-result" };
const _hoisted_2 = { class: "container" };
const _hoisted_3 = { class: "empty" };
const _hoisted_4 = { class: "empty-header" };
const _hoisted_5 = ["src"];
const _hoisted_6 = { class: "empty-title" };
const _hoisted_7 = { class: "empty-subtitle" };
const _hoisted_8 = { class: "empty-action" };
const __default__ = defineComponent({
  name: "me-page-result"
});
var script = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    title: { type: String, required: false, default: "\u9519\u8BEF\u64CD\u4F5C" },
    desc: { type: String, required: false, default: "We are sorry but our server encountered an internal error" },
    btnText: { type: String, required: false, default: "\u8FD4\u56DE\u4E0A\u4E00\u9875" },
    btnClickHandler: { type: Function, required: false },
    img: { type: String, required: false, default: "" }
  },
  setup(__props) {
    const props = __props;
    const router = useRouter();
    const ToBack = () => {
      if (router) {
        router.back();
      }
    };
    const handleAction = () => {
      if (props.btnClickHandler) {
        props.btnClickHandler();
      } else {
        ToBack();
      }
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", _hoisted_2, [
          createElementVNode("div", _hoisted_3, [
            createElementVNode("div", _hoisted_4, [
              createElementVNode("img", {
                alt: "",
                style: { "height": "36px" },
                src: __props.img
              }, null, 8, _hoisted_5)
            ]),
            createElementVNode(
              "div",
              _hoisted_6,
              toDisplayString(__props.title),
              1
              /* TEXT */
            ),
            createElementVNode(
              "div",
              _hoisted_7,
              toDisplayString(__props.desc),
              1
              /* TEXT */
            ),
            createElementVNode("div", _hoisted_8, [
              renderSlot(_ctx.$slots, "action", {}, () => [
                createElementVNode("div", {
                  class: "empty-action__btn",
                  onClick: handleAction
                }, [
                  createElementVNode("div", null, [
                    createVNode(unref(MeSvgIcon), {
                      style: { "width": "1.25rem", "height": "1.25rem", "margin": "0 12px 0 -4px" },
                      name: "ri-arrow-left-line"
                    })
                  ]),
                  createTextVNode(
                    " " + toDisplayString(__props.btnText),
                    1
                    /* TEXT */
                  )
                ])
              ])
            ])
          ])
        ])
      ]);
    };
  }
});

export { script as default };
//# sourceMappingURL=page-result.vue2.mjs.map
