<template>
    <div class="content-l">
        <p>{{ pod.pod.metadata.namespace }} / {{ pod.pod.metadata.name }}</p>
        <Chart :datasets="dataset" :config="VOLUME_CHART_CONFIG()"></Chart>
    </div>
</template>

<script setup lang="ts">
import { Data, Dataset } from '~/components/chart/Dataset';
import { MonitoredPod } from '../MonitoredResource';
import { VOLUME_CHART_CONFIG } from './ChartConfig';


const props = defineProps<{
    pod: MonitoredPod
}>();

const dataset = computed(() => {
    const result = [] as Data[];
    for (const job of props.pod.jobs)
    {
        result.push(new Data(job.average, job.timestamp));
    }
    return new Dataset("", result);
});
</script>