Adapt components with API response

This commit is contained in:
2026-04-21 19:16:11 +04:00
parent 0a96b20a85
commit 6b94f95bb8
22 changed files with 123 additions and 124 deletions
+4 -4
View File
@@ -38,20 +38,20 @@ const StyledList = styled(List)((
export default function KomanteList({commentaires}) {
return (
<StyledList className={classes.root}>
{commentaires.map(({id, attributes}) => (
{commentaires.map(({id, user, contenu, datePublication}) => (
<div key={id}>
<ListItemText
primary={
<Typography gutterBottom style={{textDecoration: 'underline'}} variant='body1'>
<small>{attributes.user.data.attributes.username}</small>
<small>{user.username}</small>
</Typography>
}
/>
<ListItemText
primary={formatJsonString(attributes.contenu)}
primary={formatJsonString(contenu)}
secondary={
<Typography gutterBottom style={{marginBlock: 5, fontStyle: 'italic'}} variant='caption' display='block'>
{format(new Date(attributes.datePublication), 'Pp', {locale: fr})}
{format(new Date(datePublication), 'Pp', {locale: fr})}
</Typography>
}
/>