<template>
    <TableComponent :loading="configMaps == null">
        <div class="resource-container config-map-container">
            <div class="header">
                <p>Name</p>
                <p>Namespace</p>
                <p>Entries</p>
                <p>Aktionen</p>
            </div>
            <ConfigMapComponent v-for="configMap, index in configMaps" :config-map="configMap" class="resource" :class="{ even: index % 2 }"></ConfigMapComponent>
        </div>
    </TableComponent>
</template>

<script setup lang="ts">
import type { ConfigMap } from '~/classes/ConfigMap';
import { ResourceRepo } from '~/classes/ResourceRepo';

const configMaps = ResourceRepo.init<ConfigMap>().load('config-maps').get();

</script>

<style scoped>
.config-map-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
}
</style>