<template>
  <div>
    <div class="approval_item">
      <div v-if="isAvatar" class="user_avatar">
        <span>{{ employeeName.charAt(0) }}</span>
      </div>
      <div class="approval_info">
        <div class="approval_person">{{ employeeName }}</div>
        <div class="approval_desc"
          >{{ certificateName }} <span v-if="certificateName">· </span>{{ departName }}</div
        >
      </div>
      <div class="approval_actions">
        <span class="cl_btn" :style="{ color: color }">{{ lastDate }}</span>
      </div>
    </div>
  </div>
</template>
<script setup>
const props = defineProps({
  id: String,
  color: {
    type: String,
    default: '#dc2627'
  },
  isAvatar: {
    type: Boolean,
    default: false
  },
  employeeName: String,
  departName: String,
  lastDate: String,
  certificateName: String
})
</script>
<style lang="less" scoped>
.approval_item {
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .user_avatar {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    text-align: center;
    line-height: 40px;
    margin-right: 10px;
    background: #e6e7eb;
    color: #374151;
  }

  .approval_info {
    flex: 1;
    .approval_person {
      font-size: 16px;
      color: #111827;
    }
    .approval_desc {
      font-size: 14px;
      color: #6b7280;
    }
  }
  .approval_actions {
    margin-left: 20px;
    .dsp_btn {
      cursor: pointer;
    }
    .cl_btn {
      display: inline-block;
      margin-left: 10px;
      font-size: 13px;
      color: #dc2627;
    }
  }
  .approval_task {
    flex: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
</style>
