const getActiveGeo = (tooltip, mapId) => {
  if (!tooltip || !tooltip.config.active || !mapId) {
    return undefined;
  }
  const {
    config: {
      props: {
        code: activeCode,
        d: activePath,
        getShowActiveGeo,
        mapId: tooltipMapId
      }
    }
  } = tooltip;
  if (tooltipMapId !== mapId) return undefined;
  const showActiveGeo = getShowActiveGeo ? getShowActiveGeo(activeCode) : true;
  return showActiveGeo && activePath;
};
export default getActiveGeo;