import type { AuthConfig, Flash, User } from '@/types' import { usePage } from '@inertiajs/vue3' import { computed } from 'vue' export function useAuth() { const page = usePage<{ auth: { user: User | null } flash: Flash authConfig: AuthConfig }>() const user = computed(() => page.props.auth.user) const isAuthenticated = computed(() => !!page.props.auth.user) const flash = computed(() => page.props.flash) const config = computed(() => page.props.authConfig) return { user, isAuthenticated, flash, config, } }