Skip to content

Commit 409095d

Browse files
committed
cp dines
1 parent 889c635 commit 409095d

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

src/components/MetadataDisplay.tsx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ interface MetadataDisplayProps {
88
showBorder?: boolean;
99
}
1010

11+
// Generate color for each key based on hash
12+
const getColorForKey = (key: string, index: number): string => {
13+
const colors = ['cyan', 'magenta', 'yellow', 'blue', 'green', 'red'];
14+
return colors[index % colors.length];
15+
};
16+
1117
export const MetadataDisplay: React.FC<MetadataDisplayProps> = ({
1218
metadata,
1319
title = 'Metadata',
@@ -20,25 +26,28 @@ export const MetadataDisplay: React.FC<MetadataDisplayProps> = ({
2026
}
2127

2228
const content = (
23-
<Box flexDirection="column">
29+
<Box flexDirection="row" alignItems="center">
2430
{title && (
25-
<Box marginBottom={1}>
31+
<>
2632
<Text color="#0a4d3a" bold>
2733
{figures.info} {title}
2834
</Text>
29-
</Box>
35+
<Text> </Text>
36+
</>
3037
)}
31-
<Box flexDirection="column" gap={0}>
32-
{entries.map(([key, value]) => (
38+
{entries.map(([key, value], index) => {
39+
const color = getColorForKey(key, index);
40+
return (
3341
<Box key={key}>
34-
<Box width={20}>
35-
<Text color="cyan">{key}</Text>
36-
</Box>
37-
<Text color="gray"> {figures.pointerSmall} </Text>
42+
<Text color={color} bold>[</Text>
43+
<Text color={color}>{key}</Text>
44+
<Text color="gray">:</Text>
3845
<Text color="white">{value}</Text>
46+
<Text color={color} bold>]</Text>
47+
<Text> </Text>
3948
</Box>
40-
))}
41-
</Box>
49+
);
50+
})}
4251
</Box>
4352
);
4453

0 commit comments

Comments
 (0)