import React from 'react' import { createStyles, CardContent, Divider, Card, Grid, Theme, Typography, withStyles, WithStyles, } from '@material-ui/core' import Content from 'components/Content' import PrettyJson from 'components/PrettyJson' import { JobData } from './sharedTypes' const definitionStyles = (theme: Theme) => createStyles({ definitionTitle: { marginTop: theme.spacing.unit * 2, marginBottom: theme.spacing.unit * 2, }, divider: { marginTop: theme.spacing.unit, marginBottom: theme.spacing.unit * 3, }, }) const Definition: React.FC< { error: unknown ErrorComponent: React.FC LoadingPlaceholder: React.FC job?: JobData['job'] } & WithStyles > = ({ classes, error, ErrorComponent, LoadingPlaceholder, job }) => { React.useEffect(() => { document.title = job?.name ? `${job.name} | Job definition` : 'Job definition' }, [job]) return ( {!error && job && ( Definition {job.type === 'Direct request' && ( )} {job.type === 'Off-chain reporting' && ( {job.definition} )} )} ) } export const JobsDefinition = withStyles(definitionStyles)(Definition) export default JobsDefinition