<template>
  <div class="able-chart" >
    <div class="title" >{{props.title}}</div>
    <div class="able" >
      <div :class="['able-item', item <= props.count ? 'able-item-active' : '']" v-for="(item) in 6" :key="item" > </div>
    </div>
    <!-- <img  :src=" item > props.count ?  staticImg.ableGrey : staticImg.able" alt="" > -->
    <img class="study" v-if="index === 0" :src="require('@/assets/component/LuojigouBoard/study1.png')" />
    <img class="study" v-if="index === 1" :src="require('@/assets/component/LuojigouBoard/study2.png')" />
    <img class="study" v-if="index === 2" :src="require('@/assets/component/LuojigouBoard/study3.png')" />
  </div>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
const staticImg = {
  ableGrey: require('@LP/assets/able-grey.png'),
  able: require('@LP/assets/able.png')
}

interface IProps {
  title: string,
  count: number | string
  index: number
}

const props = defineProps<IProps>()

</script>

<style scoped lang="scss" >
.able-chart {
  width: 303px;
  height: 64px;
  background: #FDF8F5;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  // align-items: center;
  background: url('~@/assets/component/LuojigouBoard/rect.png') no-repeat top left;
  position: relative;
  background-size: 100%;
  padding-left: 16px;
  padding-right: 16px;
  .title {
    font-size: 14px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #FF8024;
    font-size: 14px;
    margin-top: 30px;
  }
  .study {
    position: absolute;
    top: 0;
    left: 0;
    width: 79px;
    height: 14px;
  }
  .able {
    display: flex;
    margin-top: 32px;
    .able-item {
      margin-left: 2px;
      width: 32px;
      height: 12px;
      background: #FF8024;
      border-radius: 2px 2px 2px 2px;
      opacity: 0.2;
    }
    .able-item-active {
      opacity: 1;
      background: linear-gradient(180deg, #FFB27B 0%, #FF8024 100%);
    }
  }
  .able-item:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
  }
  .able-item:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
  }
}
</style>
