<template>
  <div class="user-item">
    <img width="72" :src="src" class="user1-img" alt="user" />
    <div class="user1-text">{{ text }}</div>
    <img v-if="tailSrc" class="user-tail" :src="tailSrc" alt="" 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>
.user-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

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

.user-tail {
  position: absolute;
  width: 14px;
  height: 151px;
  top: 100%;
  right: 40%;
  transform: translateX(-50%);
  pointer-events: none;
}
</style>
