<script setup lang="ts">
// import AuthLayout from '@/layouts/auth/AuthSimpleLayout.vue';
// import AuthLayout from '@/layouts/auth/AuthCardLayout.vue';
import AuthLayout from '@/layouts/auth/AuthSplitLayout.vue';
import { onMounted } from 'vue';
import { usePage } from '@inertiajs/vue3'
import axios from 'axios';

defineProps<{
    title?: string;
    description?: string;
}>();
const cron = usePage().props.cron


onMounted(() => {
    if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
        document.body.classList.add('is-mac')
    }

    if (cron) {
        triggerWebcron()
    }
})

const triggerWebcron = async function () {
    await axios.get('/webcron')
        .catch(function (response) {
            if (response.status >= 400) {
                console.error(response)
            }
        })
}
</script>

<template>
    <AuthLayout :title="title" :description="description">
        <slot />
    </AuthLayout>
</template>
