import * as React from "react";
import { Table, TableHead, TableCell, TableRow, TableBody, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
+import { UserResource } from "~/models/user";
type CssRules = 'cell';
interface MetadataProps {
items: MetadataTable[];
+ user: UserResource;
+ uuid: string;
}
export const MetadataTab = withStyles(styles)((props: MetadataProps & WithStyles<CssRules>) =>
<TableCell className={props.classes.cell}>{it.uuid}</TableCell>
<TableCell className={props.classes.cell}>{it.linkClass}</TableCell>
<TableCell className={props.classes.cell}>{it.name}</TableCell>
- <TableCell className={props.classes.cell}>{it.tailUuid}</TableCell>
- <TableCell className={props.classes.cell}>{it.headUuid}</TableCell>
- <TableCell className={props.classes.cell}>{JSON.stringify(it.properties, null, 2)}</TableCell>
+ <TableCell className={props.classes.cell}>{props.user && `User: ${props.user.firstName} ${props.user.lastName}`}</TableCell>
+ <TableCell className={props.classes.cell}>{it.headUuid === props.uuid ? 'this' : it.headUuid}</TableCell>
+ <TableCell className={props.classes.cell}>{JSON.stringify(it.properties)}</TableCell>
</TableRow>
)}
</TableBody>