fix: unifier la logique de choix de taille d'image via formatKuveti
This commit is contained in:
@@ -17,6 +17,7 @@ import {grey} from '@mui/material/colors'
|
||||
import {Link} from '@mui/material'
|
||||
|
||||
import {getAlias} from '../../lib/utils/format'
|
||||
import {formatKuveti} from '../../lib/kuveti'
|
||||
|
||||
const IMAGE_URL = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
||||
|
||||
@@ -187,9 +188,10 @@ export default function Lekte({audio, url, parole}) {
|
||||
audioRef.current.volume = value / 100
|
||||
}
|
||||
|
||||
const imagePath = parole?.couverture?.formats?.thumbnail?.url
|
||||
const width = parole?.couverture?.formats?.thumbnail?.width || 192
|
||||
const height = parole?.couverture?.formats?.thumbnail?.height || 192
|
||||
const couvertureFormat = formatKuveti(parole?.couverture, 'thumbnail')
|
||||
const imagePath = couvertureFormat?.url
|
||||
const width = couvertureFormat?.width || 192
|
||||
const height = couvertureFormat?.height || 192
|
||||
|
||||
const imageSrc = imagePath
|
||||
? new URL(imagePath, IMAGE_URL).toString()
|
||||
|
||||
Reference in New Issue
Block a user