<template>
    <div>
        <p class="grid-element" v-if="deployment.metadata">{{ deployment.metadata.name }}</p>
        <p class="grid-element" v-if="deployment.metadata">{{ deployment.metadata.namespace }}</p>
        <p class="grid-element" v-if="deployment.spec">{{ 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';

defineProps<{
    deployment: Deployment
}>();

const rescaleDeploymentPopup = ref();
</script>