@@ -376,19 +376,9 @@ function Texts({
376376 ) ;
377377}
378378
379- const addKey = ( Component : JSX . Element , key : number ) : JSX . Element => {
380- return React . cloneElement ( Component , {
381- key : Component . props . key ?? key ,
382- } ) ;
383- } ;
384-
385379function Tags ( { tags } : Readonly < { tags ?: JSX . Element [ ] } > ) {
386380 if ( ! tags ) return null ;
387- return (
388- < TagContainer data-test-id = "card__tags" >
389- { tags . map ( ( tag , i ) => addKey ( tag , i ) ) }
390- </ TagContainer >
391- ) ;
381+ return < TagContainer data-test-id = "card__tags" > { tags } </ TagContainer > ;
392382}
393383
394384const InfoItem = styled ( Flex ) . attrs ( {
@@ -407,13 +397,13 @@ function Infos({
407397} > ) {
408398 if ( ! infos ) return null ;
409399 return (
410- < InfoContainer data-testId = "data-testId" >
400+ < InfoContainer >
411401 { infos . map ( ( info ) => (
412402 < Info
413403 key = { info . value }
414404 value = { info . value }
415405 icon = { info . icon }
416- data-test-id = { info . testId }
406+ data-testid = { info . testId }
417407 />
418408 ) ) }
419409 </ InfoContainer >
@@ -423,9 +413,10 @@ function Infos({
423413function Info ( {
424414 value,
425415 icon,
416+ ...rest
426417} : Readonly < { value : string ; icon ?: JSX . Element } > ) {
427418 return (
428- < InfoItem >
419+ < InfoItem { ... rest } >
429420 { icon }
430421 < span > { value } </ span >
431422 </ InfoItem >
@@ -434,7 +425,5 @@ function Info({
434425
435426function Buttons ( { buttons } : Readonly < { buttons ?: JSX . Element [ ] } > ) {
436427 if ( ! buttons ) return null ;
437- return (
438- < ButtonContainer > { buttons . map ( ( btn , i ) => addKey ( btn , i ) ) } </ ButtonContainer >
439- ) ;
428+ return < ButtonContainer > { buttons } </ ButtonContainer > ;
440429}
0 commit comments