1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { Table, TableHead, TableCell, TableRow, TableBody, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
8 type CssRules = 'cell';
10 const styles: StyleRulesCallback<CssRules> = theme => ({
12 paddingRight: theme.spacing.unit * 2
16 interface MetadataTable {
25 interface MetadataProps {
26 items: MetadataTable[];
30 export const MetadataTab = withStyles(styles)((props: MetadataProps & WithStyles<CssRules>) =>
34 <TableCell>uuid</TableCell>
35 <TableCell>link_class</TableCell>
36 <TableCell>name</TableCell>
37 <TableCell>tail</TableCell>
38 <TableCell>head</TableCell>
39 <TableCell>properties</TableCell>
43 {props.items.map((it: any, index: number) => {
45 <TableRow key={index}>
46 {tableCell(it.uuid, props.classes)}
47 {tableCell(it.linkClass, props.classes)}
48 {tableCell(it.name, props.classes)}
49 {tableCell(it.tailUuid, props.classes)}
50 {tableCell(it.headUuid, props.classes)}
51 {tableCell(JSON.stringify(it.properties, null, 2), props.classes)}
59 const tableCell = (value: string, classes: any) =>
60 <TableCell className={classes.cell}>{value}</TableCell>;