Change teks to parole

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-20 02:15:56 +04:00
parent b8be0ccd97
commit 2aa9e63e14
13 changed files with 158 additions and 153 deletions
+10 -10
View File
@@ -31,11 +31,11 @@ const StyledGrid = styled(Grid)({
}
})
const noImageUrl = 'https://place-hold.it/140x140?text=Pa%20ni%20imaj'
const noImageUrl = 'https://place-hold.it/140x140?text=Indisponible'
export default function TeksKat({teks}) {
export default function TeksKat({parole}) {
const router = useRouter()
const {attributes} = teks
const {attributes} = parole
const {titre, artistes, annee, couverture, publishedAt, slug} = attributes
const datPiblikasyon = format(new Date(publishedAt), 'P', {locale: fr})
@@ -53,25 +53,25 @@ export default function TeksKat({teks}) {
className={classes.media}
component='img'
alt={titre}
image={couverture ? `${IMAGE_URL}${couverture.data.attributes.url}` : noImageUrl}
image={couverture?.data?.attributes?.url ? `${IMAGE_URL}${couverture.data.attributes.url}` : noImageUrl}
title={titre}
/>
<CardContent>
<Typography display='inline' style={{marginRight: 5}} variant='h6' component='h2'>
{titre}
</Typography>
{teks.eksplisit && (
{parole.eksplisit && (
<ExplicitIcon style={{marginRight: 5}} color='secondary' fontSize='small' />
)}
<Typography variant='caption'>
{teks.user && (
{parole.user && (
<>
(<i>texte soumis par {teks.user.username}</i>)
(<i>texte soumis par {parole.user.username}</i>)
</>
)}
{teks.userAdmin && !teks.user && (
{parole.userAdmin && !parole.user && (
<>
(<i>texte soumis par {teks.userAdmin}</i>)
(<i>texte soumis par {parole.userAdmin}</i>)
</>
)}
</Typography>
@@ -92,5 +92,5 @@ export default function TeksKat({teks}) {
}
TeksKat.propTypes = {
teks: PropTypes.object.isRequired
parole: PropTypes.object.isRequired
}