<!--
Container de type Card
-->

<template>
  <v-card elevation="2" outlined shaped min-height="200">
    <!-- Titre -->
    <v-card-title>
      <slot name="card.title" />
    </v-card-title>

    <!-- Texte -->
    <v-card-text>
      <slot name="card.text" />
    </v-card-text>

    <!-- Actions -->
    <v-card-actions>
      <v-spacer />

      <v-btn :icon="true">
        <NuxtLink :to="link" class="no-decoration">
          <v-icon>mdi-pencil</v-icon>
        </NuxtLink>
      </v-btn>

      <UiButtonDelete v-if="withDeleteAction" :model="model" :entity="entity" />

      <slot name="card.action" />
    </v-card-actions>
  </v-card>
</template>

<script setup lang="ts">
const props = defineProps({
  link: {
    type: String,
    required: true,
  },
  model: {
    type: Object,
    required: true,
  },
  entity: {
    type: Object,
    required: true,
  },
  withDeleteAction: {
    type: Boolean,
    required: false,
    default: true,
  },
})
</script>

<style scoped></style>
