Skip to content

Commit

Permalink
[FEAT](display): add display for tags and header
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien VIGNAU-ESPINE committed Oct 7, 2024
1 parent 73e0d56 commit 1bc0b17
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/content/series/Tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,35 @@ const Tags = ({ seriesId }: TagsProps) => {
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]]));

const json2 = JSON.parse(JSON.stringify(tags, null, 2))
const json_values2 = Object.values(json2)
var names_list2 = []
var values_list2 = []
for (var index = 0; index < json_values2.length; index++) {
names_list2.push(json_values2[index]["Name"])
values_list2.push(json_values2[index]["Value"])
}
const jsonNameValues2 = Object.fromEntries(names_list2.map((key, index) => [key, values_list2[index]]));

if (!instances) return <Spinner />
return (
<>
<Input label="Instance Number" min={1} max={instances.length} value={instanceNumber ?? 1} onChange={(event) => setInstanceNumber(Number(event.target?.value))} />
<pre>
{JSON.stringify(jsonNameValues, null, 2)}
{JSON.stringify(header, null, 2)}
{Object.entries(jsonNameValues).map(([key, value]) => (
<div key={key}>
<strong>{key}:</strong> {JSON.stringify(value)}
</div>
))}
<hr />
{Object.entries(jsonNameValues2).map(([key, value]) => (
<div key={key}>
<strong>{key}:</strong> {JSON.stringify(value)}
</div>
))}
{/* {JSON.stringify(header, null, 2)} */}
{/* {JSON.stringify(tags, null, 2)} */}
</pre>
</>
Expand Down

0 comments on commit 1bc0b17

Please sign in to comment.