import { defineComponent, resolveComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, withCtx, createTextVNode, toDisplayString, normalizeClass, createCommentVNode, createBlock } from 'vue';
import script$1 from './TsIcon.mjs';
import script$2 from './TsAvatar.mjs';
import { s as script$3 } from './normalText-66005fcf.mjs';
import './TsImageLoader.mjs';

var script = defineComponent({
    components: {
        TsIcon: script$1,
        TsAvatar: script$2,
        TsNormalText: script$3,
    },
    props: {
        users: {
            type: Object,
            required: true,
        },
        paidUsers: {
            type: [],
            required: false,
        },
        hasRemove: {
            type: Boolean,
            default: false,
        },
    },
    name: "TsUsersList",
    setup() {
        const avatarColors = [
            "bg-primaryPurple",
            "bg-primaryGreen",
            "bg-primaryOrange",
            "bg-primaryBlue",
        ];
        return {
            avatarColors,
        };
    },
});

const _hoisted_1 = { class: "flex flex-col space-y-2 w-full" };
const _hoisted_2 = { class: "flex flex-row items-center space-x-2" };
const _hoisted_3 = { class: "flex flex-row space-x-2 items-center" };
const _hoisted_4 = /*#__PURE__*/createElementVNode("span", {
  class: /*#__PURE__*/normalizeClass(`h-[4px] w-[4px] bg-paragraphTextLight rounded-full`)
}, null, -1 /* HOISTED */);
const _hoisted_5 = /*#__PURE__*/createTextVNode(" Pay ");

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_ts_avatar = resolveComponent("ts-avatar");
  const _component_ts_normal_text = resolveComponent("ts-normal-text");
  const _component_ts_icon = resolveComponent("ts-icon");

  return (openBlock(), createElementBlock("div", _hoisted_1, [
    (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.users, (user, index) => {
      return (openBlock(), createElementBlock("div", {
        class: "flex flex-row items-center space-x-2 justify-between",
        key: index
      }, [
        createElementVNode("div", _hoisted_2, [
          createVNode(_component_ts_avatar, {
            bgColor: 
            _ctx.avatarColors[Math.floor(Math.random() * _ctx.avatarColors.length)]
          ,
            customClass: 'text-white',
            photoUrl: user.bio.photo?.link || '',
            size: '25'
          }, {
            default: withCtx(() => [
              createTextVNode(toDisplayString(user.bio.name.first.charAt(0)), 1 /* TEXT */)
            ]),
            _: 2 /* DYNAMIC */
          }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["bgColor", "photoUrl"]),
          createElementVNode("div", _hoisted_3, [
            createVNode(_component_ts_normal_text, null, {
              default: withCtx(() => [
                createTextVNode(toDisplayString(user.bio.name.full), 1 /* TEXT */)
              ]),
              _: 2 /* DYNAMIC */
            }, 1024 /* DYNAMIC_SLOTS */),
            (!_ctx.hasRemove)
              ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                  createElementVNode("span", {
                    class: normalizeClass(`h-[4px] w-[4px] ${
                _ctx.paidUsers?.includes(user.id)
                  ? 'bg-primaryGreen'
                  : 'bg-errorColor'
              }  rounded-full`)
                  }, null, 2 /* CLASS */),
                  createVNode(_component_ts_normal_text, {
                    color: `${
                _ctx.paidUsers?.includes(user.id)
                  ? 'text-primaryGreen'
                  : 'text-errorColor'
              }`
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.paidUsers?.includes(user.id) ? "Paid" : "Unpaid"), 1 /* TEXT */)
                    ]),
                    _: 2 /* DYNAMIC */
                  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["color"]),
                  (!_ctx.paidUsers?.includes(user.id))
                    ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                        _hoisted_4,
                        createVNode(_component_ts_normal_text, { color: 'text-primaryPurple' }, {
                          default: withCtx(() => [
                            _hoisted_5
                          ]),
                          _: 1 /* STABLE */
                        })
                      ], 64 /* STABLE_FRAGMENT */))
                    : createCommentVNode("v-if", true)
                ], 64 /* STABLE_FRAGMENT */))
              : createCommentVNode("v-if", true)
          ])
        ]),
        (_ctx.hasRemove)
          ? (openBlock(), createBlock(_component_ts_icon, {
              key: 0,
              name: "remove",
              customClass: 'h-[15px]'
            }))
          : createCommentVNode("v-if", true)
      ]))
    }), 128 /* KEYED_FRAGMENT */))
  ]))
}

script.render = render;
script.__file = "src/components/TsUsersList/index.vue";

export { script as default };
