From cb049886bb3e5c8a363e2711485a60521c1a9f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Famibelle-Pronzola?= Date: Sun, 19 Mar 2023 21:35:33 +0400 Subject: [PATCH] Prevent display error when no parole for an artist --- components/awtis/awtis-detay.js | 16 ++++++++++------ components/awtis/awtis-kat.js | 30 ++++++++++++++++-------------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/components/awtis/awtis-detay.js b/components/awtis/awtis-detay.js index 0d66fe1..627ff54 100644 --- a/components/awtis/awtis-detay.js +++ b/components/awtis/awtis-detay.js @@ -85,12 +85,16 @@ export default function AwtisDetay({anAwtis}) { ) : ( - <> - Parole - - - - + paroles.data.length === 0 ? ( + Aucune parole pour le moment + ) : ( + <> + Parole + + + + + ) )} diff --git a/components/awtis/awtis-kat.js b/components/awtis/awtis-kat.js index 71697d6..a93d388 100644 --- a/components/awtis/awtis-kat.js +++ b/components/awtis/awtis-kat.js @@ -86,24 +86,26 @@ export default function AwtisKat({artiste}) { {alias} - {`${paroles.data.length} ${paroles.data.length > 1 ? 'paroles' : 'parole'}`} + {`${paroles.data.length === 0 ? 'Aucune parole pour le moment' : `${paroles.data.length} ${paroles.data.length > 1 ? 'paroles' : 'parole'}`}`} - - - - - + {paroles.data.length > 0 && ( + + + + + + )}