@@ -73,17 +73,16 @@ const Page = () => {
7373 ) : (
7474 < div className = { cn ( styles . Main ) } >
7575 < div className = "flex flex-wrap gap-24" >
76- { [
77- ...( params . entityType === 'organization'
78- ? allEntitiesList . data . organisations
79- : allEntitiesList . data . dataspaces ) ,
80- ] ?. map ( ( entityItem ) => (
81- < EntityCard
82- key = { entityItem . slug }
83- entityItem = { entityItem }
84- params = { params }
85- />
86- ) ) }
76+ { ( params . entityType === 'organization'
77+ ? allEntitiesList . data . organizations
78+ : allEntitiesList . data . dataspaces
79+ ) ?. map ( ( entityItem : any ) => {
80+ return (
81+ < div key = { entityItem . name } >
82+ < EntityCard entityItem = { entityItem } params = { params } />
83+ </ div >
84+ ) ;
85+ } ) }
8786 < div className = "flex h-72 w-56 flex-col items-center justify-center gap-3 rounded-2 bg-baseGraySlateSolid6 p-4" >
8887 < Icon source = { Icons . plus } size = { 40 } color = "success" />
8988 < Text alignment = "center" variant = "headingMd" >
@@ -100,26 +99,27 @@ const Page = () => {
10099
101100export default Page ;
102101
103- const EntityCard = ( { key , entityItem, params } : any ) => {
102+ const EntityCard = ( { entityItem, params } : any ) => {
104103 const [ isImageValid , setIsImageValid ] = useState ( ( ) => {
105- return entityItem . logo ? true : false ;
104+ return entityItem ? .logo ? true : false ;
106105 } ) ;
106+
107107 return (
108108 < div
109- key = { key }
109+ key = { entityItem . name }
110110 className = "flex h-72 w-56 flex-col items-center gap-3 rounded-2 border-2 border-solid border-baseGraySlateSolid4 px-4 py-5 text-center"
111111 >
112112 < div className = "flex h-full w-full items-center justify-center rounded-2" >
113113 < Link
114- href = { `/dashboard/${ params . entityType } /${ entityItem . slug } /dataset` }
114+ href = { `/dashboard/${ params . entityType } /${ entityItem ? .slug } /dataset` }
115115 id = { entityItem . slug }
116116 >
117117 < div className = "border-var(--border-radius-5) rounded-2" >
118118 { isImageValid ? (
119119 < Image
120120 height = { 160 }
121121 width = { 160 }
122- src = { `${ process . env . NEXT_PUBLIC_BACKEND_URL } ${ entityItem . logo . url } ` }
122+ src = { `${ process . env . NEXT_PUBLIC_BACKEND_URL } ${ entityItem ? .logo . url } ` }
123123 alt = { `${ entityItem . name } logo` }
124124 onError = { ( ) => {
125125 setIsImageValid ( false ) ;
0 commit comments