import type { Context } from "react"; import { createContext, createRef } from "react"; import { mapDefaults } from "../config"; import type { TCluster, TMapContext, TPanelData, TPoint, } from "../config/types"; export const MapContext: Context = createContext({ getCN: (el: string, mod = {}, utilClasses = []) => "", instanceRef: createRef(), containerRef: createRef(), balloonRef: createRef(), maxActivePoints: mapDefaults.maxActivePoints, modules: mapDefaults.modules, zoom: mapDefaults.zoom, options: mapDefaults.options, api: mapDefaults.api, currentClusters: [], clusters: [], panelData: null, stateActions: { setIsDisabled: (isDisabled: boolean) => {}, setClusters: (clusters: TCluster[]) => {}, setPanelData: (data: TPanelData) => {}, setPointState: (idPoint: TPoint["id"], state: unknown) => {}, }, });