<template>
  <transition
      name="list-edit-transition"
      tag="div"
      class="list-edit-container"

  >
    <div      v-if="show" class="list-edit">
    <icon-button variant="blue" icon="pencil-simple" help-text="Edit all selected calculations" @click="handleAction('edit')"></icon-button>
    <icon-button variant="blue" icon="trash" help-text="Delete all selected calculations" @click="handleAction('delete')"></icon-button>
    <icon-button variant="blue" icon="archive" help-text="Archive all selected calculations" @click="handleAction('archive')"></icon-button>
<!--    <icon-button variant="blue" icon="pencil-simple" ></icon-button>-->
<!--    <icon-button variant="blue" icon="trash" ></icon-button>-->
<!--    <icon-button variant="blue" icon="archive" ></icon-button>-->
      </div>
  </transition>

</template>

<script>
import IconButton from "@/components/UI/IconButton.vue";

export default{
  name: "ListEdit",
  components: {IconButton},
  emits: ['action'],
  props: {
    show: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleAction(action) {
      this.$emit('action', action);
    }
  }
}
</script>

<style scoped>

.list-edit-container {
  position: fixed;
  bottom: 2rem;
  left:  50%;
  transform: translate(-50%, 0);
  z-index: 9999;
}

.list-edit {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  background-color: #5AF0B4;
  border-radius: 0.8rem;
  flex: 0 0 auto;
  padding: 0.8rem 1.6rem;
  box-shadow: 0 0.4rem 0.6rem -0.1rem rgba(0, 0, 0, 0.1);
}



/* Transition animations */
.list-edit-transition-enter-active {
  transition: all 0.3s ease;
}

.list-edit-transition-leave-active {
  transition: all 0.3s ease;
}

.list-edit-transition-enter-from {
  opacity: 0;
  transform: translate(-50%, 100%); /* beide Transforms kombinieren */
}

.list-edit-transition-leave-to {
  opacity: 0;
  transform: translate(-50%, 100%); /* beide Transforms kombinieren */
}

.list-edit-transition-move {
  transition: transform 0.3s ease;
}

</style>