<template>
    <div>
        <p class="grid-element">{{ deployment.metadata.name }}</p>
        <p class="grid-element">{{ deployment.metadata.namespace }}</p>
        <p class="grid-element">{{ calcAge(deployment.metadata.creationTimestamp) }}</p>
        <p class="grid-element">{{ deployment.spec.replicas }}</p>
        <div class="grid-element action-buttons">
            <ActionButton>delete</ActionButton>
            <ActionButton>autorenew</ActionButton>
            <ActionButton @click="() => rescaleDeploymentPopup.open()">height</ActionButton>
        </div>
        <RescaleDeploymentPopup ref="rescaleDeploymentPopup" :deployment="deployment"></RescaleDeploymentPopup>
    </div>
</template>

<script setup lang="ts">
import { Deployment } from '~/classes/Deployment';
import RescaleDeploymentPopup from '../RescaleDeploymentPopup.vue';
import { calcAge } from '~/classes/Pod';

defineProps<{
    deployment: Deployment
}>();

const rescaleDeploymentPopup = ref();
</script>