<template>
    <div>
        <p class="grid-element" @click="usePopup().open(DeploymentViewPopup, deployment)">{{ 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 @click="usePopup().open(DeploymentLogPopup, deployment)">text_snippet</ActionButton>
            <ActionButton>autorenew</ActionButton>
            <ActionButton @click="usePopup().open(DeploymentRescalePopup, deployment)">height</ActionButton>
        </div>
    </div>
</template>

<script setup lang="ts">
import { Deployment } from '~/classes/Deployment';
import { calcAge } from '~/classes/Pod';
import DeploymentRescalePopup from './view/DeploymentRescalePopup.vue';
import DeploymentViewPopup from "~/components/deployment/view/DeploymentViewPopup.vue";
import DeploymentLogPopup from "~/components/deployment/view/DeploymentLogPopup.vue";
import {usePopup} from "~/components/popup/Popup";

defineProps<{
    deployment: Deployment
}>();
</script>