From fcf73d8dbc54d931fb7538247463b614c051a1ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Voskuhl?= <juergen.voskuhl@itcv-software.com>
Date: Fri, 29 Sep 2023 07:35:59 +0200
Subject: [PATCH] Infobox 'combined standards'

---
 components/it-standards/LifecyclePicture.tsx | 34 +++++++++++++-------
 1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/components/it-standards/LifecyclePicture.tsx b/components/it-standards/LifecyclePicture.tsx
index a5cf27b..75a818a 100644
--- a/components/it-standards/LifecyclePicture.tsx
+++ b/components/it-standards/LifecyclePicture.tsx
@@ -1,4 +1,5 @@
 import useImgPath from 'shared/use-img-path'
+import MY_CONSTANTS from '@/lib/constants-standards.js'
 
 const { getImgPath } = useImgPath()
 
@@ -8,17 +9,26 @@ type LifecylceOptions = {
 // Display the image corresponding to the lifecycle phase
 export default ({ status } : LifecylceOptions) => {
     const imagePath = `/img/standards/lifecycle/${status}.svg`
-    console.log(status)
 
-    return (
-        <div className="border border-gray-300 rounded-lg overflow-hidden py-2">
-            {/* Die Next.js Image-Komponente verwendet das "src" Attribut */}
-            <img
-                src={getImgPath(imagePath)}
-                alt={`Bild für Tag ${status}`}
-                width={500} // Breite des Bildes
-                height={0} // Höhe des Bildes
-            />
-        </div>
-    )
+    if (MY_CONSTANTS.LYFE_CYCLE_PHASES.includes(status)) {
+        return (
+            <div className="border border-gray-300 rounded-lg overflow-hidden py-2">
+                {/* Die Next.js Image-Komponente verwendet das "src" Attribut */}
+                <img
+                    src={getImgPath(imagePath)}
+                    alt={`${status}`}
+                    width={500} // Breite des Bildes
+                    height={0} // Höhe des Bildes
+                />
+            </div>
+        )
+    }
+    else {
+        return (
+            <div className="border border-gray-300 rounded-lg overflow-hidden p-2">
+                #INVALID! (tags.status)
+            </div>
+
+        )
+    }
 }
-- 
GitLab