<template>
     <IconAction color="white" class="return-home" v-if="globalStore.lastRoute" icon="fa-solid fa-xmark" @click="router.push(globalStore.lastRoute)"/>
</template>
<script setup>
import IconAction from '@/components/UI/IconAction.vue';
import { useRouter } from 'vue-router';
import { useGlobalStore } from '@/stores/globalStore';
const globalStore = useGlobalStore();
const router = useRouter();
</script>
<style scoped>
.return-home {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #FFFFFF;
    cursor: pointer;
}
.return-home:hover {
    color: var(--text-hover);
}
.icon {
    font-size: 1.3em;
    transition: filter 0.3s ease;
}
.icon:hover {
   cursor: pointer;
   filter: brightness(0.8);
}
</style>
