Fix aliases error when featuring
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user