import { useHjPolygon } from '../../Hangjing/hooks/hangjingPolygon'

interface IPolygonData {
  id: string
  position: number[]
  color?: string
}

const hangjingMap: Map<string, any> = new Map()
const { addHangjingPolygon, removeHangjingPolygon } = useHjPolygon(hangjingMap)

export const useYsHangjing = () => {
  const addYsHangjing = (data: Record<string, any>[]) => {
    addHangjingPolygon(data)
  }

  const removeHangjing = (id: string) => {
    removeHangjingPolygon(id)
  }

  return {
    addYsHangjing,
    removeHangjing,
  }
}
