-
Notifications
You must be signed in to change notification settings - Fork 572
/
Copy pathGraphPropertiesTable.tsx
39 lines (37 loc) · 1.64 KB
/
GraphPropertiesTable.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { GraphLabel, Typography } from '@neo4j-ndl/react';
import { GraphPropertiesTableProps } from '../../types';
const GraphPropertiesTable = ({ propertiesWithTypes }: GraphPropertiesTableProps): JSX.Element => {
console.log('props', propertiesWithTypes);
return (
<div className="flex w-full flex-col break-all px-4 text-sm" data-testid="viz-details-pane-properties-table">
<div className="mb-1 flex flex-row pl-2">
<Typography variant="body-medium" className="basis-1/3">
Key
</Typography>
<Typography variant="body-medium">Value</Typography>
</div>
{propertiesWithTypes.map(({ key, value }, _) => {
return (
<div
key={key}
className="border-palette-neutral-border-weak flex border-t py-1 pl-2 first:border-none"
>
<div className="shrink basis-1/3 overflow-hidden whitespace-nowrap">
<GraphLabel
type="propertyKey"
tabIndex={-1}
className="pointer-events-none !max-w-full overflow-ellipsis"
>
{key}
</GraphLabel>
</div>
<div className={`ml-2 flex-1 whitespace-pre-wrap`}>
{value}
</div>
</div>
);
})}
</div>
);
};
export default GraphPropertiesTable;