<script>
import VulnerabilityChartLabel from './vulnerability_chart_label.vue';

export default {
  name: 'VulnerabilityChartTooltip',
  components: {
    VulnerabilityChartLabel,
  },
  props: {
    title: {
      type: String,
      required: false,
      default: '',
    },
    entries: {
      type: Array,
      required: true,
    },
  },
};
</script>

<template>
  <div class="card">
    <div class="card-header">
      <strong> {{ title }} </strong>
    </div>
    <div class="card-body">
      <vulnerability-chart-label
        v-for="entry in entries"
        :key="entry.seriesId + entry.dataIndex"
        :name="entry.seriesName"
        :value="entry.data[1]"
        :color="entry.color"
      />
    </div>
  </div>
</template>
