import { useQuery } from '@tanstack/react-query';
import { getAnnotations } from '../api/generated/sdk.gen';

export function useAnnotations() {
  const query = useQuery({
    queryKey: ['annotations'],
    queryFn: () => getAnnotations(),
  });

  const annotations = query.data?.annotations || query.data?.data?.annotations || [];

  return { 
    ...query, 
    annotations
  };
}