@@ -69,7 +69,11 @@ const Centers = () => {
6969 const [ firstName , setFirstName ] = useState ( '' ) ;
7070 const [ totalCount , setTotalCount ] = useState ( 0 ) ;
7171 const [ totalCountBatch , setTotalCountBatch ] = useState ( 0 ) ;
72- const storedProgram = localStorage . getItem ( 'program' ) ;
72+
73+ const storedProgram =
74+ typeof window !== 'undefined'
75+ ? localStorage . getItem ( 'tenantName' ) ?? localStorage . getItem ( 'program' )
76+ : null ;
7377
7478 const { t, i18n } = useTranslation ( ) ;
7579 const initialFormData = localStorage . getItem ( 'stateId' )
@@ -130,6 +134,7 @@ const Centers = () => {
130134 }
131135 } ) ;
132136 alterSchema . required = requiredArray ;
137+
133138 //add max selection custom
134139 if ( alterSchema ?. properties ?. state ) {
135140 alterSchema . properties . state . maxSelection = 1 ;
@@ -350,10 +355,16 @@ const Centers = () => {
350355 key : 'image' ,
351356 label : 'Images' ,
352357 render : ( row : any ) => {
353- console . log ( 'Row in image column:' , row ) ;
358+ const rawImage = row ?. image ;
359+ const images : string [ ] = Array . isArray ( rawImage )
360+ ? rawImage
361+ : typeof rawImage === 'string' && rawImage
362+ ? [ rawImage ]
363+ : [ ] ;
364+
354365 return (
355366 < div style = { { display : 'flex' , gap : '8px' } } >
356- { row ?. image ? .map ( ( imgUrl : string , index : number ) => (
367+ { images . map ( ( imgUrl : string , index : number ) => (
357368 < img
358369 key = { index }
359370 src = { imgUrl }
@@ -491,7 +502,9 @@ const Centers = () => {
491502 setOpenBatchModal ( true ) ;
492503 // console.log('row in view batch', row);
493504 } ,
494- show : ( row ) => row . status !== 'archived' ,
505+ show : ( row ) =>
506+ row . status !== 'archived' &&
507+ storedProgram === TenantName . SECOND_CHANCE_PROGRAM ,
495508 } ,
496509 {
497510 icon : (
0 commit comments