import React from 'react' import { createStyles } from '@material-ui/core' import Card from '@material-ui/core/Card' import Grid from '@material-ui/core/Grid' import { withStyles, WithStyles } from '@material-ui/core/styles' import { stringify } from 'javascript-stringify' import capitalize from 'lodash/capitalize' import StatusItem from './StatusItem' import { DirectRequestJobRun } from '../../sharedTypes' const fontStyles = () => createStyles({ header: { fontFamily: 'Roboto Mono', fontWeight: 'bold', fontSize: '14px', color: '#818ea3', }, subHeader: { fontFamily: 'Roboto Mono', fontSize: '12px', color: '#818ea3', }, }) interface ItemProps extends WithStyles { colATitle: string colAValue: string colBTitle: string colBValue?: string } const Item = withStyles(fontStyles)( ({ colATitle, colAValue, colBTitle, colBValue, classes }: ItemProps) => (

{colATitle}

{stringify(colAValue)}

{colBTitle}

{stringify(colBValue) || 'No Value Available'}

), ) interface InitiatorProps { params: object } const Initiator = ({ params }: InitiatorProps) => { const paramsArr = Object.entries(params) return ( <> {JSON.stringify(paramsArr) === '[]' ? ( ) : ( paramsArr.map((par, idx) => ( )) )} ) } interface ParamsProps { params?: object } const Params = ({ params }: ParamsProps) => { return (
{Object.entries(params || {}).map((p, idx) => ( ))}
) } interface ResultProps { run: DirectRequestJobRun['taskRuns'][0] } const Result = ({ run }: ResultProps) => { const data = run?.result?.data const result = data && 'result' in data ? data.result : '' return ( ) } interface Props { jobRun: DirectRequestJobRun } export const Overview = ({ jobRun }: Props) => { const initiator = jobRun.initiator return (
{jobRun.taskRuns.map((taskRun) => { return ( {taskRun.task && } ) })}
) }