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

import { trackingService } from "../services/tracking.service";

export const useTracking = (consignmentId: string) =>
  useQuery({
    queryKey: ["tracking", consignmentId],
    queryFn: () => trackingService.forConsignment(consignmentId),
    enabled: Boolean(consignmentId),
  });
