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

interface TraceFilterParams {
  start?: string;
  end?: string;
  service?: string;
  limit?: number;
  offset?: number;
}

export function useTraces(params?: TraceFilterParams) {
  return useQuery({
    queryKey: ['otel', 'traces', params],
    queryFn: () => fetchTraces(params),
  });
}
