import "../../../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { defineComponent, watch, resolveComponent, openBlock, createBlock, withCtx, createElementVNode as createBaseVNode, createElementBlock, Fragment, renderList } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { reactive } from "../../../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString } from "../../../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _hoisted_1 = /* @__PURE__ */ createBaseVNode("thead", null, [
  /* @__PURE__ */ createBaseVNode("tr", null, [
    /* @__PURE__ */ createBaseVNode("th", null, "key"),
    /* @__PURE__ */ createBaseVNode("th", null, "value")
  ])
], -1);
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "displayTable",
  props: {
    target: Object
  },
  setup(__props) {
    const props = __props;
    const defaultItem = {
      key: "",
      value: ""
    };
    const tableArray = reactive({ content: [] });
    watch(
      () => props.target,
      (target) => {
        tableArray.content = [];
        for (const k in target) {
          tableArray.content.push({
            key: k,
            value: target[k]
          });
        }
        if (!tableArray.content.length)
          tableArray.content = [JSON.parse(JSON.stringify(defaultItem))];
      },
      {
        immediate: true,
        deep: true
      }
    );
    return (_ctx, _cache) => {
      const _component_n_table = resolveComponent("n-table");
      return openBlock(), createBlock(_component_n_table, {
        bordered: false,
        "single-line": false,
        size: "small",
        style: { "border-bottom-right-radius": "7px", "border-bottom-left-radius": "7px" }
      }, {
        default: withCtx(() => [
          _hoisted_1,
          createBaseVNode("tbody", null, [
            (openBlock(true), createElementBlock(Fragment, null, renderList(tableArray.content, (item, index) => {
              return openBlock(), createElementBlock("tr", { key: index }, [
                createBaseVNode("td", null, toDisplayString(item.key || "暂无"), 1),
                createBaseVNode("td", null, toDisplayString(item.value || "暂无"), 1)
              ]);
            }), 128))
          ])
        ]),
        _: 1
      });
    };
  }
});
export {
  _sfc_main as default
};
