UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

22 lines (21 loc) 702 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatEventLocationGeolocation = exports.formatCroppedName = void 0; const formatCroppedName = (name, maxLength) => { if (name.length <= maxLength) { return name; } return name.substring(0, maxLength) + '...'; }; exports.formatCroppedName = formatCroppedName; const formatEventLocationGeolocation = (geolocation, isTitle) => { if (!geolocation) { return null; } const parts = geolocation.split('.'); if (isTitle) { return parts[0].trim(); } return parts.slice(1).join(',').trim(); }; exports.formatEventLocationGeolocation = formatEventLocationGeolocation;