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
+6 -6
View File
@@ -169,14 +169,14 @@ export default function Teks({parole}) {
</Box>
</Typography>
{parole?.user?.data && (
{parole?.user && (
<Typography style={{marginBottom: '1.5em'}} display='block' variant='caption'>
<i>parole soumise par {parole.user.data.attributes.username}</i>
<i>parole soumise par {parole.user.username}</i>
</Typography>
)}
{parole?.userAdmin?.data && !parole.user.data && (
{parole?.userAdmin&& !parole.user && (
<Typography style={{marginBottom: '1.5em'}} display='block' variant='caption'>
<i>parole soumise par {parole.userAdmin.data.attributes.firstname}</i>
<i>parole soumise par {parole.userAdmin.firstname}</i>
</Typography>
)}
{parole.creativeCommons && (
@@ -184,8 +184,8 @@ export default function Teks({parole}) {
<LicenseModal license={parole.creativeCommons.toLowerCase()} />
</Box>
)}
{parole?.files?.data && (
<FilesDialog files={parole.files.data} />
{parole?.files && (
<FilesDialog files={parole.files} />
)}
{(parole.okiMizikID || parole.streamAudio.length > 0 || parole.gadeEmbed) && (
<Box sx={{textAlign: 'center'}}>