UNPKG

@hisptz/react-ui

Version:

A collection of reusable complex DHIS2 react ui components.

14 lines 530 B
// Get the longest text length from an object property in an array import L from "leaflet"; export const getLongestTextLength = (array, key) => array.reduce((text, curr) => curr[key] && String(curr[key]).length > text.length ? String(curr[key]) : text, "").length; export function getIconUrl(icon, _ref) { let { baseUrl } = _ref; return "".concat(baseUrl, "/images/orgunitgroup/").concat(icon !== null && icon !== void 0 ? icon : "01.png"); } export function getIcon(url) { return new L.Icon({ iconUrl: url }); }