- {komante.map(({id, username, kontni, sentAt}) => (
+ {commentaires.map(({id, attributes}) => (
- {username}
+
+ {attributes.user.data.attributes.username}
}
/>
- {format(new Date(sentAt), 'Pp', {locale: fr})}
+ {format(new Date(attributes.datePublication), 'Pp', {locale: fr})}
}
/>
@@ -63,5 +63,5 @@ export default function KomanteList({komante}) {
}
KomanteList.propTypes = {
- komante: PropTypes.array.isRequired
+ commentaires: PropTypes.array.isRequired
}
diff --git a/components/komante/vwe-komante.js b/components/komante/vwe-komante.js
index a4e3989..bc4f3d7 100644
--- a/components/komante/vwe-komante.js
+++ b/components/komante/vwe-komante.js
@@ -45,7 +45,7 @@ const Root = styled('div')((
const KomanteTooltip = Tooltip
-export default function VweKomante({komante, teks}) {
+export default function VweKomante({commentaires, parole, paroleId}) {
const [esOuve, meteEsOuve] = useState(false)
const [esKoneksyonOuve, meteEsKoneksyonOuve] = useState(false)
const [esKomenteOuve, meteEsKomanteOuve] = useState(false)
@@ -88,7 +88,7 @@ export default function VweKomante({komante, teks}) {
size='large'
onClick={handleClick}
>
-
+
@@ -109,8 +109,8 @@ export default function VweKomante({komante, teks}) {
tabIndex={-1}
component='div'
>
- {komante.length > 0 ? (
-
+ {commentaires.length > 0 ? (
+
) : (
Aucun commentaire
@@ -140,7 +140,7 @@ export default function VweKomante({komante, teks}) {
)}
{session && session.user && esKomenteOuve && (
<>
-
+
@@ -152,10 +152,11 @@ export default function VweKomante({komante, teks}) {
}
VweKomante.defaultProps = {
- komante: null
+ commentaires: null
}
VweKomante.propTypes = {
- komante: PropTypes.array,
- teks: PropTypes.object.isRequired
+ commentaires: PropTypes.array,
+ parole: PropTypes.object.isRequired,
+ paroleId: PropTypes.number.isRequired
}