import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, unref, withModifiers, createVNode, normalizeClass } from "vue";
import { _ as _sfc_main$1, d as defaultAvatar } from "./index4.js";
import { _ as _sfc_main$2 } from "./index5.js";
import { t as typeDetection } from "./utils.js";
import { _ as _export_sfc } from "./index2.js";
import "dayjs";
import "vant";
import "@wltech/svg";
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
const _hoisted_1 = { class: "render-card-users" };
const _hoisted_2 = ["onClick"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: () => {
      return {};
    } },
    listItem: { default: () => {
      return {};
    } },
    is_trial: { type: Boolean, default: false }
  },
  emits: ["onItem"],
  setup(__props, { emit }) {
    const props = __props;
    const list = computed(() => {
      return typeDetection(props.data) === "object" ? [props.data] : props.data;
    });
    const onItem = (item) => {
      var _a;
      if (!((_a = props.listItem) == null ? void 0 : _a.allowClick))
        return;
      emit("onItem", {
        data: item,
        listItem: props.listItem
      });
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(unref(list), (item) => {
          var _a, _b;
          return openBlock(), createElementBlock("div", {
            class: "users-item",
            key: item.id,
            onClick: withModifiers(($event) => onItem(item), ["stop"])
          }, [
            createVNode(_sfc_main$1, {
              src: item.head_img_url || unref(defaultAvatar),
              alt: ""
            }, null, 8, ["src"]),
            createVNode(_sfc_main$2, {
              class: normalizeClass(["user-name", {
                "user-name--clickable": ((_a = props.listItem) == null ? void 0 : _a.allowClick) && ((_b = props.listItem) == null ? void 0 : _b.viewType)
              }]),
              name: item.nick_name,
              openid: item.userid_third,
              is_trial: __props.is_trial
            }, null, 8, ["class", "name", "openid", "is_trial"])
          ], 8, _hoisted_2);
        }), 128))
      ]);
    };
  }
});
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-90add3e6"]]);
export { index as default };
