import { useQuery } from 'react-query';

import { employeeLifecycleKeys } from '../queries';
import { getOnboardingsNotifications } from '../services';

export const useOnboardingsNotifications = () => {
  const { data, ...query } = useQuery({
    queryKey: employeeLifecycleKeys.notifications.employeeLifecycle(),
    queryFn: () => getOnboardingsNotifications(),
    select: response => response.data,
  });

  return {
    ...query,
    notifications: data,
  };
};
