import { useQuery } from '@tanstack/react-query';
import { partnerCenterApi } from '../apis';
import { centerKeys } from '../keys';
import { PARTNER_LIST_STALE_TIME, PARTNER_GC_TIME } from '../constants';

/** The nurses the signed-in center sponsors (portal). */
export function useMySponsoredNurses() {
  return useQuery({
    queryKey: centerKeys.mySponsoredNurses(),
    queryFn: () => partnerCenterApi.listMySponsoredNurses(),
    staleTime: PARTNER_LIST_STALE_TIME,
    gcTime: PARTNER_GC_TIME,
  });
}
