import { IOfflineData } from '@client/offline/reducer' ; export function getValueWithPercentageString ( value , total ) { return `${ value } (${ total ? Math . floor ( ( value / total ) * 100 ) : 0 }%)` ; } export function getLocationFromPartOfLocationId ( locationId , offlineResources ) { const id = ( locationId && locationId . split ( '/' ) [ 1 ] ) || '' ; return ( offlineResources . locations [ id ] || offlineResources . offices [ id ] || { name : '' } ) ; }