<template>
    <TableComponent :loading="deployments == null">
        <div class="resource-container deployment-container">
            <div class="header">
                <p>Name</p>
                <p>Namespace</p>
                <p>Replicas</p>
                <p>Aktionen</p>
            </div>
            <DeploymentComponent :deployment="deployment" v-for="deployment, index in deployments" class="resource" :class="{ even: index % 2 }"></DeploymentComponent>
        </div>
    </TableComponent>
</template>

<script setup lang="ts">
import type { Deployment } from '~/classes/Deployment';
import { ResourceRepo } from '~/classes/ResourceRepo';
import DeploymentComponent from '~/components/deployments/DeploymentComponent.vue';

const deployments = ResourceRepo.init<Deployment>().load('deployments').get();
</script>

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