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

export function useTrace(traceId: string) {
  return useQuery({
    queryKey: ['otel', 'trace', traceId],
    queryFn: () => fetchTrace(traceId),
    enabled: !!traceId,
  });
}
