<template>
  <div class="main" v-if="values.length > 0">
    <div style="font-size:15px">{{ title }}</div>
    <div class="content">
      <WindturbineMinCard
        v-for="vs in values"
        :key="vs"
        :status="vs.status"
        :power="vs.power"
        :windSpeed="vs.windSpeed"
        :rollSpeed="vs.rollSpeed"
        :windturbineId="vs.windturbineId"
      ></WindturbineMinCard>
    </div>
    <div class="bottom"></div>
  </div>
</template>

<script>
import WindturbineMinCard from "./WindturbineMinCard.vue";
export default {
  name: "MatrixCard",
  props: ["title", "datas"],
  data() {
    return {
      values: [],
    };
  },

  mounted() {
    this.values = this.datas.value || [];
  },

  components: {
    WindturbineMinCard,
  },

  watch: {
    datas(val) {
      this.values = val.value;
    },
  },
};
</script>

<style scoped>
.content {
  display: grid;
  grid-template-columns: repeat(5, 20%);
}
.bottom {
  background-color: #292929;
  width: 100%;
  height: 2px;
  margin-top: 5px;
}
.main {
  margin-bottom: 15px;
  margin-left: 5px;
  margin-right: 5px;
}
</style>