<template>
  <div class="h5-user-item">
    <img :src="src" class="user1-img" alt="user" />
    <div class="user1-text">{{ text }}</div>
    <img v-if="tailSrc" class="user-tail" :src="tailSrc" alt="user" aria-hidden="true" />
  </div>
</template>
<script setup>
import defaultUserSrc from '~/assets/svg/home/user1.svg'

const props = defineProps({
  text: {
    type: String,
    default: "正常访客",
    required: true,
  },
  src: {
    type: String,
    default: defaultUserSrc,
    required: true,
  },
  tailSrc: {
    type: String,
    default: "",
  },
});
</script>
<style lang="scss" scoped>
.h5-user-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .user1-img {
    width: 22px;
  }

  .user1-text {
    display: flex;
    width: 46px;
    height: 15px;
    justify-content: center;
    align-items: center;
    align-self: stretch;
    border-radius: 4px;
    border: 1px solid #A39DFF;
    background: #3F337D;
    color: #FFF;
    font-size: 10px;
    font-weight: 400;
    line-height: 10px;
  }

  .user-tail {
    position: absolute;
    width: 3px;
    height: 30px;
    top: 100%;
    right: 48%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
  }
}
</style>
