From 1373e80d346d6e2ee3e7639a097633fea3552aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Thu, 16 Apr 2026 13:55:20 +0400 Subject: [PATCH] Optimize lekte component --- components/teks/lekte.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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}