import { useQuery } from '@tanstack/react-query';

import { AuthService } from '@/client/services/AuthService';

export function useCurrentUser() {
  return useQuery({
    queryKey: ['auth', 'me'],
    queryFn: () => AuthService.authGetCurrentUser().then((r) => r.data),
    staleTime: 1000 * 60 * 5,
    retry: false,
  });
}
