<template>
  <div class="baseCard">
    <div class="text">
      <div class="title">{{ props.count }}</div>
      <div class="subTitle">{{ props.title }}</div>
    </div>
    <e-charts :data="props.data"></e-charts>
  </div>
</template>

<script setup lang="ts">
defineOptions({
  name: 'BaseCard',
})

type Props = {
  count: number
  title: string
  data: {
    value: string
    name: string
    itemStyle: {
      color: string
    }
  }[]
}

const props = withDefaults(defineProps<Props>(), {
  count: 123,
  title: '设备数量',
  data: () => [],
})
</script>

<style scoped lang="less">
.baseCard {
  width: 250px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;

  .text {
    flex-shrink: 0;
    flex-grow: 1;
    text-align: center;

    .title {
      font-size: 32px;
      margin-bottom: 8px;
    }

    .subTitle {
      font-size: 16px;
      color: #666;
    }
  }
}
</style>
