<script setup lang="ts">
import MainHeader from "@/Components/FlightsGoneBy/MainHeader.vue";
import MainFooter from "@/Components/FlightsGoneBy/MainFooter.vue";
import Radar from "@/Components/FlightsGoneBy/Radar.vue";
import { usePage, router } from "@inertiajs/vue3";
import { ref } from "vue";

const page = usePage();
const transitionKey = ref(0);

router.on('success', () => {
    transitionKey.value++;
});
</script>

<template>
    <Radar>
        <div class="layoutContainer">
            <MainHeader />
            <Transition name="fade" mode="out-in">
                <main id="pageContainer" :key="transitionKey">
                    <slot />
                </main>
            </Transition>
            <MainFooter />
        </div>
    </Radar>
</template>

<style scoped>
.layoutContainer {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
}

main {
    flex: 1 0 90dvh;
    min-height: 0;
    padding: 1rem;
    background:transparent;
    display:flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


.fade-enter-from,
.fade-leave-to {
    opacity: 0;
    transform: translateY(10px);
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

</style>
