<script setup lang="ts">
const props = defineProps({
  title: String,
  text: String,
  confirm_text: {
    type: String,
    required: false
  },
  cancel_text: {
    type: String,
    required: false
  },
  item: {
    type: Object,
    required: false
  },
  bulk: Boolean,
  loading: {
    type: Boolean,
    required: false
  },
  hide_confirm: {
    type: Boolean,
    required: false
  }
})

console.log(props.loading)
</script>

<template>
  <v-card>
    <v-card-title>
      <h3>{{ props.title }}</h3>
    </v-card-title>
    <v-card-text>
      <p>{{ props.text }}</p>
      <slot></slot>
    </v-card-text>
    <v-card-actions>
      <v-btn
      color="primary"
      @click="$emit('confirm',true, props.bulk, item)"
      :loading="loading"
      v-if="hide_confirm != true"
      >Conferma</v-btn>
      <v-btn
          color="accent"
          @click="$emit('confirm',false)"
      >Annulla</v-btn>
    </v-card-actions>
  </v-card>
</template>

<style scoped>

</style>