import { UserAuth } from '#shared/types/dto'; import { PageProps } from '@adonisjs/inertia/types'; import { usePage } from '@inertiajs/react'; const useAuth = (): UserAuth => usePage().props.auth as UserAuth; const withAuth = ( Component: React.ComponentType ) => { return (props: T) => { const auth = useAuth(); return ; }; }; export { useAuth, withAuth };