import type { VesselAnalysisDto } from '../types';

const API_BASE = '/api/kcg';

export async function fetchVesselAnalysis(): Promise<VesselAnalysisDto[]> {
  const res = await fetch(`${API_BASE}/vessel-analysis`, {
    headers: { accept: 'application/json' },
  });
  if (!res.ok) return [];
  const data: { count: number; items: VesselAnalysisDto[] } = await res.json();
  return data.items ?? [];
}
