import { useQuery } from '@tanstack/react-query';
import { accountDetails } from '@/lib/dashboard/dashboard-api';

export const useAccountDetails = (
  customerId: string | number,
  bureau: 'transunion' | 'equifax' | 'experian',
  selectedDate: string | undefined | null
) => {
  return useQuery({
    queryKey: ['account-details', customerId, bureau, selectedDate],
    queryFn: async () => {
      const res = await accountDetails(customerId, bureau, selectedDate);
      return res;
    },
    staleTime: 1000 * 60 * 5,
  });
};
