<template>
  <div class="data-chart-switch-box-wrapper">
    <div class="item" :class="{ 'item-acitve': isShowData }">
      <div class="icon">
        <img src="./data-acitve.svg" alt="" v-if="isShowData">
        <img src="./data.svg" alt="" v-else>
      </div>
      <div class="text text-tip-1" :class="{ 'text-active': isShowData }">{{ "数据" }}</div>
    </div>
    <div class="item" :class="{ 'item-acitve': !isShowData }">
      <div class="icon">
        <img src="./chart.svg" alt="" v-if="isShowData">
        <img src="./chart-active.svg" alt="" v-else>
      </div>
      <div class="text text-tip-1" :class="{ 'text-active': !isShowData }">{{ "图表" }}</div>
    </div>
  </div>
</template>

<script setup>

const props = defineProps({
  isShowData: {
    type: Boolean,
    default: true
  }
})


</script>

<style lang="scss" scoped>
.data-chart-switch-box-wrapper {
  width: 160px;
  height: 28px;
  border: 1px solid var(--color-primary-100);
  display: flex;
  border-radius: 20px;
  overflow: hidden;

  .item-acitve {
    background: var(--color-primary-100);
  }

  .item {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;


    .icon {
      width: 16px;
      height: 16px;

      img {
        width: 100%;
        height: 100%;
      }
    }

    .text {
      color: var(--color-primary-100);
    }

    .text-active {
      color: var(--bg-white-100) !important;
    }
  }
}
</style>