File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import {
3232} from '@/services/CohortService/cohortService' ;
3333import ConfirmationPopup from '@/components/ConfirmationPopup' ;
3434import { updateCohort } from '@/services/MasterDataService' ;
35- import { transformLabel } from '@/utils/Helper' ;
35+ import { transformLabel , transformLabelWithoutSpaces } from '@/utils/Helper' ;
3636import { useTheme } from '@mui/material/styles' ;
3737import AddIcon from '@mui/icons-material/Add' ;
3838import CenteredLoader from '@/components/CenteredLoader/CenteredLoader' ;
@@ -279,7 +279,7 @@ const Centers = () => {
279279 {
280280 key : 'name' ,
281281 label : 'Center Name' ,
282- render : ( row : any ) => transformLabel ( row ?. name ) ,
282+ render : ( row : any ) => transformLabelWithoutSpaces ( row ?. name ) ,
283283 } ,
284284 {
285285 key : 'address' ,
Original file line number Diff line number Diff line change @@ -139,6 +139,17 @@ export const transformLabel = (label: string): string => {
139139 . replace ( / \b \w / g, ( char ) => char . toUpperCase ( ) ) ; // Capitalize the first letter of each word
140140} ;
141141
142+ export const transformLabelWithoutSpaces = ( label : string ) : string => {
143+ if ( typeof label !== 'string' ) {
144+ return label as any ;
145+ }
146+
147+ return label
148+ . toLowerCase ( )
149+ . replace ( / \b \w / g, ( char ) => char . toUpperCase ( ) ) ;
150+ } ;
151+
152+
142153export const transformArray = ( arr : State [ ] ) : State [ ] => {
143154 if ( ! arr || ! Array . isArray ( arr ) ) {
144155 return arr ;
You can’t perform that action at this time.
0 commit comments