Fix aliases error when featuring

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-22 00:17:28 +04:00
parent db6edcfec4
commit ebabc7b442
5 changed files with 15 additions and 14 deletions
+4 -2
View File
@@ -14,6 +14,8 @@ import Image from 'next/image'
import {grey} from '@mui/material/colors'
import {Link} from '@mui/material'
import {getAlias} from '../../lib/utils/format'
const IMAGE_URL = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
const Widget = styled('div')(({theme}) => ({
@@ -58,7 +60,7 @@ export default function Lekte({audio, url, parole}) {
const [position, setPosition] = useState(0)
const [volume, setVolume] = useState(100)
const [isPlaying, setIsPlaying] = useState(false)
const awtis = parole.artistes.data.map(({attributes}) => attributes.alias)
const alias = getAlias(parole.artistes, parole.prioriteArtistes)
function formatDuration(value) {
const minute = Math.floor(value / 60)
@@ -147,7 +149,7 @@ export default function Lekte({audio, url, parole}) {
</CoverImage>
<Box sx={{ml: 1.5, minWidth: 0}}>
<Typography fontWeight={500}>
{new Intl.ListFormat('fr').format(awtis)}
{alias}
</Typography>
<Typography>
<Link underline='hover' sx={{cursor: 'pointer'}} target='_blank' rel='noreferrer' href={url}>