import { useCallback } from 'react';
const useSortBoundariesCompare = function useSortBoundariesCompare(colors) {
  return useCallback((a, b) => {
    const aColor = colors.fipsToPalette.get(a.code);
    const bColor = colors.fipsToPalette.get(b.code);
    const aIsUnclear = !aColor || aColor.status === 'unclear';
    const bIsUnclear = !bColor || bColor.status === 'unclear';
    if (aIsUnclear && bIsUnclear) return 0;
    if (!aIsUnclear && !bIsUnclear) return 0;
    if (aIsUnclear) return 1;
    return -1;
  }, [colors]);
};
export default useSortBoundariesCompare;