Adapt components with API response
This commit is contained in:
@@ -137,9 +137,9 @@ export default function Lekte({audio, url, parole}) {
|
||||
audioRef.current.volume = value / 100
|
||||
}
|
||||
|
||||
const imagePath = parole?.couverture?.data?.attributes?.formats?.thumbnail?.url
|
||||
const width = parole?.couverture?.data?.attributes?.formats?.thumbnail?.width || 192
|
||||
const height = parole?.couverture?.data?.attributes?.formats?.thumbnail?.height || 192
|
||||
const imagePath = parole?.couverture?.formats?.thumbnail?.url
|
||||
const width = parole?.couverture?.formats?.thumbnail?.width || 192
|
||||
const height = parole?.couverture?.formats?.thumbnail?.height || 192
|
||||
|
||||
const imageSrc = imagePath
|
||||
? new URL(imagePath, IMAGE_URL).toString()
|
||||
|
||||
Reference in New Issue
Block a user