From 73e0d5625fb6ac53073b6cb040a6e8fa9b09244c Mon Sep 17 00:00:00 2001 From: Julien VIGNAU-ESPINE Date: Mon, 7 Oct 2024 15:50:17 +0200 Subject: [PATCH] [FEAT](json): parsing of the header json to only get names and values --- src/content/series/Tags.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/content/series/Tags.tsx b/src/content/series/Tags.tsx index bbe981e6..cc80f76d 100644 --- a/src/content/series/Tags.tsx +++ b/src/content/series/Tags.tsx @@ -30,13 +30,25 @@ const Tags = ({ seriesId }: TagsProps) => { } ) + const json = JSON.parse(JSON.stringify(header, null, 2)) + const json_values = Object.values(json) + var names_list = [] + var values_list = [] + for (var index = 0; index < json_values.length; index++) { + names_list.push(json_values[index]["Name"]) + values_list.push(json_values[index]["Value"]) + } + + const jsonNameValues = Object.fromEntries(names_list.map((key, index) => [key, values_list[index]])); + if (!instances) return return ( <> setInstanceNumber(Number(event.target?.value))} />
-                {JSON.stringify(header, null, 2)}
-                {JSON.stringify(tags, null, 2)}
+                {JSON.stringify(jsonNameValues, null, 2)}
+                {JSON.stringify(header, null, 2)} 
+                {/* {JSON.stringify(tags, null, 2)} */}
             
)