Change komante to commentaire

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-20 02:19:10 +04:00
parent 47bc07c5d8
commit e76a7cf8cc
3 changed files with 47 additions and 40 deletions
+7 -7
View File
@@ -35,23 +35,23 @@ const StyledList = styled(List)((
}
}))
export default function KomanteList({komante}) {
export default function KomanteList({commentaires}) {
return (
<StyledList className={classes.root}>
{komante.map(({id, username, kontni, sentAt}) => (
{commentaires.map(({id, attributes}) => (
<div key={id}>
<ListItemText
primary={
<Typography gutterBottom style={{fontWeight: 'bold'}} variant='body1'>
{username}
<Typography gutterBottom style={{textDecoration: 'underline'}} variant='body1'>
<small>{attributes.user.data.attributes.username}</small>
</Typography>
}
/>
<ListItemText
primary={formatJsonString(kontni)}
primary={formatJsonString(attributes.contenu)}
secondary={
<Typography gutterBottom style={{marginBlock: 5, fontStyle: 'italic'}} variant='caption' display='block'>
{format(new Date(sentAt), 'Pp', {locale: fr})}
{format(new Date(attributes.datePublication), 'Pp', {locale: fr})}
</Typography>
}
/>
@@ -63,5 +63,5 @@ export default function KomanteList({komante}) {
}
KomanteList.propTypes = {
komante: PropTypes.array.isRequired
commentaires: PropTypes.array.isRequired
}