import { useMemo } from 'react';
import type { AisTarget } from '../../../entities/aisTarget/model/types';
import type { LegacyVesselInfo } from '../../../entities/legacyVessel/model/types';
import { toLiveShipFeatures } from '../lib/adapters';

export function useLiveShipAdapter(
  targets: AisTarget[],
  legacyHits?: Map<number, LegacyVesselInfo> | null,
) {
  return useMemo(() => toLiveShipFeatures(targets, legacyHits), [targets, legacyHits]);
}
