<template>
    <div>
        <p class="grid-element">{{ configMap.metadata.name }}</p>
        <p class="grid-element">{{ configMap.metadata.namespace }}</p>
        <p class="grid-element">{{ Object.keys(configMap.data).length }}</p>
        <div class="grid-element">
            <ActionButton v-if="hasAnyRole(getUser(), ['admin', 'maintainer'])">delete</ActionButton>
        </div>
    </div>
</template>

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

defineProps<{
    configMap: ConfigMap
}>();
</script>