diff --git a/components/teks/lekte.js b/components/teks/lekte.js index 667e506..6486a20 100644 --- a/components/teks/lekte.js +++ b/components/teks/lekte.js @@ -137,6 +137,14 @@ 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 imageSrc = imagePath + ? new URL(imagePath, IMAGE_URL).toString() + : '/logo-192x192.png' + return ( @@ -144,9 +152,9 @@ export default function Lekte({audio, url, parole}) { {parole.titre}