b1cfdb3e91d2cfd00937c2c270a4f0296b66522f
[arvados-workbench2.git] / src / views / process-panel / process-io-card.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import React, { ReactElement, useState } from 'react';
6 import { Dispatch } from 'redux';
7 import {
8     StyleRulesCallback,
9     WithStyles,
10     withStyles,
11     Card,
12     CardHeader,
13     IconButton,
14     CardContent,
15     Tooltip,
16     Typography,
17     Tabs,
18     Tab,
19     Table,
20     TableHead,
21     TableBody,
22     TableRow,
23     TableCell,
24     Paper,
25     Grid,
26     Chip,
27 } from '@material-ui/core';
28 import { ArvadosTheme } from 'common/custom-theme';
29 import { CloseIcon, ImageIcon, InfoIcon, InputIcon, ImageOffIcon, OutputIcon } from 'components/icon/icon';
30 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
31 import {
32   BooleanCommandInputParameter,
33   CommandInputParameter,
34   CWLType,
35   Directory,
36   DirectoryArrayCommandInputParameter,
37   DirectoryCommandInputParameter,
38   EnumCommandInputParameter,
39   FileArrayCommandInputParameter,
40   FileCommandInputParameter,
41   FloatArrayCommandInputParameter,
42   FloatCommandInputParameter,
43   IntArrayCommandInputParameter,
44   IntCommandInputParameter,
45   isArrayOfType,
46   isPrimitiveOfType,
47   StringArrayCommandInputParameter,
48   StringCommandInputParameter,
49 } from "models/workflow";
50 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
51 import { File } from 'models/workflow';
52 import { getInlineFileUrl } from 'views-components/context-menu/actions/helpers';
53 import { AuthState } from 'store/auth/auth-reducer';
54 import mime from 'mime';
55 import { DefaultView } from 'components/default-view/default-view';
56 import { getNavUrl } from 'routes/routes';
57 import { Link as RouterLink } from 'react-router-dom';
58 import { Link as MuiLink } from '@material-ui/core';
59 import { InputCollectionMount } from 'store/processes/processes-actions';
60 import { connect } from 'react-redux';
61 import { RootState } from 'store/store';
62 import { ProcessOutputCollectionFiles } from './process-output-collection-files';
63 import { Process } from 'store/processes/process';
64 import { navigateTo } from 'store/navigation/navigation-action';
65
66 type CssRules = 'card' | 'content' | 'title' | 'header' | 'avatar' | 'iconHeader' | 'tableWrapper' | 'tableRoot' | 'paramValue' | 'keepLink' | 'collectionLink' | 'imagePreview' | 'valArray' | 'emptyValue' | 'halfRow' | 'symmetricTabs' | 'imagePlaceholder' | 'rowWithPreview';
67
68 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
69     card: {
70         height: '100%'
71     },
72     header: {
73         paddingTop: theme.spacing.unit,
74         paddingBottom: theme.spacing.unit,
75     },
76     iconHeader: {
77         fontSize: '1.875rem',
78         color: theme.customs.colors.green700,
79     },
80     avatar: {
81         alignSelf: 'flex-start',
82         paddingTop: theme.spacing.unit * 0.5
83     },
84     content: {
85         padding: theme.spacing.unit * 1.0,
86         paddingTop: theme.spacing.unit * 0.5,
87         '&:last-child': {
88             paddingBottom: theme.spacing.unit * 1,
89         }
90     },
91     title: {
92         overflow: 'hidden',
93         paddingTop: theme.spacing.unit * 0.5
94     },
95     tableWrapper: {
96         overflow: 'auto',
97     },
98     tableRoot: {
99         width: '100%',
100         '& thead th': {
101             verticalAlign: 'bottom',
102             paddingBottom: '10px',
103         }
104     },
105     paramValue: {
106         display: 'flex',
107         alignItems: 'flex-start',
108         flexDirection: 'column',
109     },
110     keepLink: {
111         color: theme.palette.primary.main,
112         textDecoration: 'none',
113         overflowWrap: 'break-word',
114         cursor: 'pointer',
115     },
116     collectionLink: {
117         margin: '10px',
118         '& a': {
119             color: theme.palette.primary.main,
120             textDecoration: 'none',
121             overflowWrap: 'break-word',
122             cursor: 'pointer',
123         }
124     },
125     imagePreview: {
126         maxHeight: '15em',
127         maxWidth: '15em',
128         marginBottom: theme.spacing.unit,
129     },
130     valArray: {
131         display: 'flex',
132         gap: '10px',
133         flexWrap: 'wrap',
134         '& span': {
135             display: 'inline',
136         }
137     },
138     emptyValue: {
139         color: theme.customs.colors.grey500,
140     },
141     halfRow: {
142         '& td': {
143             borderBottom: 'none',
144         }
145     },
146     symmetricTabs: {
147         '& button': {
148             flexBasis: '0',
149         }
150     },
151     imagePlaceholder: {
152         width: '60px',
153         height: '60px',
154         display: 'flex',
155         alignItems: 'center',
156         justifyContent: 'center',
157         backgroundColor: '#cecece',
158         borderRadius: '10px',
159     },
160     rowWithPreview: {
161         verticalAlign: 'bottom',
162     }
163 });
164
165 export enum ProcessIOCardType {
166     INPUT = 'Inputs',
167     OUTPUT = 'Outputs',
168 }
169 export interface ProcessIOCardDataProps {
170     process: Process;
171     label: ProcessIOCardType;
172     params: ProcessIOParameter[];
173     raw?: any;
174     mounts?: InputCollectionMount[];
175     outputUuid?: string;
176 }
177
178 export interface ProcessIOCardActionProps {
179     navigateTo: (uuid: string) => void;
180 }
181
182 const mapDispatchToProps = (dispatch: Dispatch): ProcessIOCardActionProps => ({
183     navigateTo: (uuid) => dispatch<any>(navigateTo(uuid)),
184 });
185
186 type ProcessIOCardProps = ProcessIOCardDataProps & ProcessIOCardActionProps & WithStyles<CssRules> & MPVPanelProps;
187
188 export const ProcessIOCard = withStyles(styles)(connect(null, mapDispatchToProps)(
189     ({ classes, label, params, raw, mounts, outputUuid, doHidePanel, panelName, process, navigateTo }: ProcessIOCardProps) => {
190         const [mainProcTabState, setMainProcTabState] = useState(0);
191         const handleMainProcTabChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
192             setMainProcTabState(value);
193         }
194
195         const [showImagePreview, setShowImagePreview] = useState(false);
196
197         const PanelIcon = label === ProcessIOCardType.INPUT ? InputIcon : OutputIcon;
198         const mainProcess = !process.containerRequest.requestingContainerUuid;
199
200         return <Card className={classes.card} data-cy="process-io-card">
201             <CardHeader
202                 className={classes.header}
203                 classes={{
204                     content: classes.title,
205                     avatar: classes.avatar,
206                 }}
207                 avatar={<PanelIcon className={classes.iconHeader} />}
208                 title={
209                     <Typography noWrap variant='h6' color='inherit'>
210                         {label}
211                     </Typography>
212                 }
213                 action={
214                     <div>
215                         { mainProcess && <Tooltip title={"Toggle Image Preview"} disableFocusListener>
216                             <IconButton data-cy="io-preview-image-toggle" onClick={() =>{setShowImagePreview(!showImagePreview)}}>{showImagePreview ? <ImageIcon /> : <ImageOffIcon />}</IconButton>
217                         </Tooltip> }
218                         { doHidePanel &&
219                         <Tooltip title={`Close ${panelName || 'panel'}`} disableFocusListener>
220                             <IconButton onClick={doHidePanel}><CloseIcon /></IconButton>
221                         </Tooltip> }
222                     </div>
223                 } />
224             <CardContent className={classes.content}>
225                 <div>
226                     {mainProcess ?
227                         (<>
228                             {params.length ?
229                                 <>
230                                     <Tabs value={mainProcTabState} onChange={handleMainProcTabChange} variant="fullWidth" className={classes.symmetricTabs}>
231                                         <Tab label="Parameters" />
232                                         <Tab label="JSON" />
233                                     </Tabs>
234                                     {mainProcTabState === 0 && <div className={classes.tableWrapper}>
235                                             <ProcessIOPreview data={params} showImagePreview={showImagePreview} />
236                                         </div>}
237                                     {mainProcTabState === 1 && <div className={classes.tableWrapper}>
238                                             <ProcessIORaw data={raw || params} />
239                                         </div>}
240                                 </> :
241                                 <Grid container item alignItems='center' justify='center'>
242                                     <DefaultView messages={["No parameters found"]} />
243                                 </Grid>
244                             }
245                         </>) :
246                         (<>
247                             {((mounts && mounts.length) || outputUuid) ?
248                                 <>
249                                     <Tabs value={0} variant="fullWidth" className={classes.symmetricTabs}>
250                                         {label === ProcessIOCardType.INPUT && <Tab label="Collections" />}
251                                         {label === ProcessIOCardType.OUTPUT && <Tab label="Collection" />}
252                                     </Tabs>
253                                     <div className={classes.tableWrapper}>
254                                         {label === ProcessIOCardType.INPUT && <ProcessInputMounts mounts={mounts || []} />}
255                                         {label === ProcessIOCardType.OUTPUT && <>
256                                             {outputUuid && <Typography className={classes.collectionLink}>
257                                                 Output Collection: <MuiLink className={classes.keepLink} onClick={() => {navigateTo(outputUuid || "")}}>
258                                                 {outputUuid}
259                                             </MuiLink></Typography>}
260                                             <ProcessOutputCollectionFiles isWritable={false} currentItemUuid={outputUuid} />
261                                         </>}
262                                     </div>
263                                 </> :
264                                 <Grid container item alignItems='center' justify='center'>
265                                     <DefaultView messages={["No collection(s) found"]} />
266                                 </Grid>
267                             }
268                         </>)
269                     }
270                 </div>
271             </CardContent>
272         </Card>;
273     }
274 ));
275
276 export type ProcessIOValue = {
277     display: ReactElement<any, any>;
278     imageUrl?: string;
279     collection?: ReactElement<any, any>;
280 }
281
282 export type ProcessIOParameter = {
283     id: string;
284     label: string;
285     value: ProcessIOValue[];
286 }
287
288 interface ProcessIOPreviewDataProps {
289     data: ProcessIOParameter[];
290     showImagePreview: boolean;
291 }
292
293 type ProcessIOPreviewProps = ProcessIOPreviewDataProps & WithStyles<CssRules>;
294
295 const ProcessIOPreview = withStyles(styles)(
296     ({ classes, data, showImagePreview }: ProcessIOPreviewProps) => {
297         const showLabel = data.some((param: ProcessIOParameter) => param.label);
298         return <Table className={classes.tableRoot} aria-label="Process IO Preview">
299             <TableHead>
300                 <TableRow>
301                     <TableCell>Name</TableCell>
302                     {showLabel && <TableCell>Label</TableCell>}
303                     <TableCell>Value</TableCell>
304                     <TableCell>Collection</TableCell>
305                 </TableRow>
306             </TableHead>
307             <TableBody>
308                 {data.map((param: ProcessIOParameter) => {
309                     const firstVal = param.value.length > 0 ? param.value[0] : undefined;
310                     const rest = param.value.slice(1);
311                     const rowClass = rest.length > 0 ? classes.halfRow : undefined;
312
313                     return <>
314                         <TableRow className={rowClass} data-cy="process-io-param">
315                             <TableCell>
316                                 {param.id}
317                             </TableCell>
318                             {showLabel && <TableCell >{param.label}</TableCell>}
319                             <TableCell>
320                                 {firstVal && <ProcessValuePreview value={firstVal} showImagePreview={showImagePreview} />}
321                             </TableCell>
322                             <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
323                                 <Typography className={classes.paramValue}>
324                                     {firstVal?.collection}
325                                 </Typography>
326                             </TableCell>
327                         </TableRow>
328                         {rest.map((val, i) => (
329                             <TableRow className={(i < rest.length-1) ? rowClass : undefined}>
330                                 <TableCell />
331                                 {showLabel && <TableCell />}
332                                 <TableCell>
333                                     <ProcessValuePreview value={val} showImagePreview={showImagePreview} />
334                                 </TableCell>
335                                 <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
336                                     <Typography className={classes.paramValue}>
337                                         {val.collection}
338                                     </Typography>
339                                 </TableCell>
340                             </TableRow>
341                         ))}
342                     </>;
343                 })}
344             </TableBody>
345         </Table>;
346 });
347
348 interface ProcessValuePreviewProps {
349     value: ProcessIOValue;
350     showImagePreview: boolean;
351 }
352
353 const ProcessValuePreview = withStyles(styles)(
354     ({value, showImagePreview, classes}: ProcessValuePreviewProps & WithStyles<CssRules>) =>
355         <Typography className={classes.paramValue}>
356             {value.imageUrl && showImagePreview ? <img className={classes.imagePreview} src={value.imageUrl} alt="Inline Preview" /> : ""}
357             {value.imageUrl && !showImagePreview ? <ImagePlaceholder /> : ""}
358             <span className={classes.valArray}>
359                 {value.display}
360             </span>
361         </Typography>
362 )
363
364 const handleClick = (url) => {
365     window.open(url, '_blank');
366 }
367
368
369 interface ProcessIORawDataProps {
370     data: ProcessIOParameter[];
371 }
372
373 const ProcessIORaw = withStyles(styles)(
374     ({ data }: ProcessIORawDataProps) =>
375         <Paper elevation={0}>
376             <pre>
377                 {JSON.stringify(data, null, 2)}
378             </pre>
379         </Paper>
380 );
381
382 interface ProcessInputMountsDataProps {
383     mounts: InputCollectionMount[];
384 }
385
386 type ProcessInputMountsProps = ProcessInputMountsDataProps & WithStyles<CssRules>;
387
388 const ProcessInputMounts = withStyles(styles)(connect((state: RootState) => ({
389     auth: state.auth,
390 }))(({ mounts, classes, auth }: ProcessInputMountsProps & { auth: AuthState }) => (
391     <Table className={classes.tableRoot} aria-label="Process Input Mounts">
392         <TableHead>
393             <TableRow>
394                 <TableCell>Path</TableCell>
395                 <TableCell>Portable Data Hash</TableCell>
396             </TableRow>
397         </TableHead>
398         <TableBody>
399             {mounts.map(mount => (
400                 <TableRow key={mount.path}>
401                     <TableCell><pre>{mount.path}</pre></TableCell>
402                     <TableCell>
403                         <RouterLink to={getNavUrl(mount.pdh, auth)} className={classes.keepLink}>{mount.pdh}</RouterLink>
404                     </TableCell>
405                 </TableRow>
406             ))}
407         </TableBody>
408     </Table>
409 )));
410
411 type FileWithSecondaryFiles = {
412     secondaryFiles: File[];
413 }
414
415 export const getIOParamDisplayValue = (auth: AuthState, input: CommandInputParameter | CommandOutputParameter, pdh?: string): ProcessIOValue[] => {
416     switch (true) {
417         case isPrimitiveOfType(input, CWLType.BOOLEAN):
418             const boolValue = (input as BooleanCommandInputParameter).value;
419
420             return boolValue !== undefined &&
421                     !(Array.isArray(boolValue) && boolValue.length === 0) ?
422                 [{display: <pre>{String(boolValue)}</pre> }] :
423                 [{display: <EmptyValue />}];
424
425         case isPrimitiveOfType(input, CWLType.INT):
426         case isPrimitiveOfType(input, CWLType.LONG):
427             const intValue = (input as IntCommandInputParameter).value;
428
429             return intValue !== undefined &&
430                     // Missing values are empty array
431                     !(Array.isArray(intValue) && intValue.length === 0) ?
432                 [{display: <pre>{String(intValue)}</pre> }]
433                 : [{display: <EmptyValue />}];
434
435         case isPrimitiveOfType(input, CWLType.FLOAT):
436         case isPrimitiveOfType(input, CWLType.DOUBLE):
437             const floatValue = (input as FloatCommandInputParameter).value;
438
439             return floatValue !== undefined &&
440                     !(Array.isArray(floatValue) && floatValue.length === 0) ?
441                 [{display: <pre>{String(floatValue)}</pre> }]:
442                 [{display: <EmptyValue />}];
443
444         case isPrimitiveOfType(input, CWLType.STRING):
445             const stringValue = (input as StringCommandInputParameter).value || undefined;
446
447             return stringValue !== undefined &&
448                     !(Array.isArray(stringValue) && stringValue.length === 0) ?
449                 [{display: <pre>{stringValue}</pre> }] :
450                 [{display: <EmptyValue />}];
451
452         case isPrimitiveOfType(input, CWLType.FILE):
453             const mainFile = (input as FileCommandInputParameter).value;
454             // secondaryFiles: File[] is not part of CommandOutputParameter so we cast to access secondaryFiles
455             const secondaryFiles = ((mainFile as unknown) as FileWithSecondaryFiles)?.secondaryFiles || [];
456             const files = [
457                 ...(mainFile && !(Array.isArray(mainFile) && mainFile.length === 0) ? [mainFile] : []),
458                 ...secondaryFiles
459             ];
460
461             return files.length ?
462                 files.map(file => fileToProcessIOValue(file, auth, pdh)) :
463                 [{display: <EmptyValue />}];
464
465         case isPrimitiveOfType(input, CWLType.DIRECTORY):
466             const directory = (input as DirectoryCommandInputParameter).value;
467
468             return directory !== undefined &&
469                     !(Array.isArray(directory) && directory.length === 0) ?
470                 [directoryToProcessIOValue(directory, auth, pdh)] :
471                 [{display: <EmptyValue />}];
472
473         case typeof input.type === 'object' &&
474             !(input.type instanceof Array) &&
475             input.type.type === 'enum':
476             const enumValue = (input as EnumCommandInputParameter).value;
477
478             return enumValue !== undefined ?
479                 [{ display: <pre>{(input as EnumCommandInputParameter).value || ''}</pre> }] :
480                 [{display: <EmptyValue />}];
481
482         case isArrayOfType(input, CWLType.STRING):
483             const strArray = (input as StringArrayCommandInputParameter).value || [];
484             return strArray.length ?
485                 [{ display: <>{((input as StringArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
486                 [{display: <EmptyValue />}];
487
488         case isArrayOfType(input, CWLType.INT):
489         case isArrayOfType(input, CWLType.LONG):
490             const intArray = (input as IntArrayCommandInputParameter).value || [];
491
492             return intArray.length ?
493                 [{ display: <>{((input as IntArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
494                 [{display: <EmptyValue />}];
495
496         case isArrayOfType(input, CWLType.FLOAT):
497         case isArrayOfType(input, CWLType.DOUBLE):
498             const floatArray = (input as FloatArrayCommandInputParameter).value || [];
499
500             return floatArray.length ?
501                 [{ display: <>{floatArray.map((val) => <Chip label={val} />)}</> }] :
502                 [{display: <EmptyValue />}];
503
504         case isArrayOfType(input, CWLType.FILE):
505             const fileArrayMainFile = ((input as FileArrayCommandInputParameter).value || []);
506             const fileArraySecondaryFiles = fileArrayMainFile.map((file) => (
507                 ((file as unknown) as FileWithSecondaryFiles)?.secondaryFiles || []
508             )).reduce((acc: File[], params: File[]) => (acc.concat(params)), []);
509
510             const fileArrayFiles = [
511                 ...fileArrayMainFile,
512                 ...fileArraySecondaryFiles
513             ];
514
515             return fileArrayFiles.length ?
516                 fileArrayFiles.map(file => fileToProcessIOValue(file, auth, pdh)) :
517                 [{display: <EmptyValue />}];
518
519         case isArrayOfType(input, CWLType.DIRECTORY):
520             const directories = (input as DirectoryArrayCommandInputParameter).value || [];
521
522             return directories.length ?
523                 directories.map(directory => directoryToProcessIOValue(directory, auth, pdh)) :
524                 [{display: <EmptyValue />}];
525
526         default:
527             return [];
528     }
529 };
530
531 const getKeepUrl = (file: File | Directory, pdh?: string): string => {
532     const isKeepUrl = file.location?.startsWith('keep:') || false;
533     const keepUrl = isKeepUrl ? file.location : pdh ? `keep:${pdh}/${file.location}` : file.location;
534     return keepUrl || '';
535 };
536
537 interface KeepUrlProps {
538     auth: AuthState;
539     res: File | Directory;
540     pdh?: string;
541 }
542
543 const KeepUrlBase = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
544     const keepUrl = getKeepUrl(res, pdh);
545     const pdhUrl = keepUrl ? keepUrl.split('/').slice(0, 1)[0] : '';
546     // Passing a pdh always returns a relative wb2 collection url
547     const pdhWbPath = getNavUrl(pdhUrl.replace('keep:', ''), auth);
548     return pdhUrl && pdhWbPath ?
549         <Tooltip title={"View collection in Workbench"}><RouterLink to={pdhWbPath} className={classes.keepLink}>{pdhUrl}</RouterLink></Tooltip> :
550         <></>;
551 });
552
553 const KeepUrlPath = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
554     const keepUrl = getKeepUrl(res, pdh);
555     const keepUrlParts = keepUrl ? keepUrl.split('/') : [];
556     const keepUrlPath = keepUrlParts.length > 1 ? keepUrlParts.slice(1).join('/') : '';
557
558     const keepUrlPathNav = getKeepNavUrl(auth, res, pdh);
559     return keepUrlPath && keepUrlPathNav ?
560         <Tooltip title={"View in keep-web"}><MuiLink className={classes.keepLink} onClick={() => handleClick(keepUrlPathNav)}>{keepUrlPath}</MuiLink></Tooltip> :
561         // Show No value for root collection io that lacks path part
562         <EmptyValue />;
563 });
564
565 const getKeepNavUrl = (auth: AuthState, file: File | Directory, pdh?: string): string => {
566     let keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
567     return (getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl));
568 };
569
570 const getImageUrl = (auth: AuthState, file: File, pdh?: string): string => {
571     const keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
572     return getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl);
573 };
574
575 const isFileImage = (basename?: string): boolean => {
576     return basename ? (mime.getType(basename) || "").startsWith('image/') : false;
577 };
578
579 const normalizeDirectoryLocation = (directory: Directory): Directory => {
580     if (!directory.location) {
581         return directory;
582     }
583     return {
584         ...directory,
585         location: (directory.location || '').endsWith('/') ? directory.location : directory.location + '/',
586     };
587 };
588
589 const directoryToProcessIOValue = (directory: Directory, auth: AuthState, pdh?: string): ProcessIOValue => {
590     const normalizedDirectory = normalizeDirectoryLocation(directory);
591     return {
592         display: <KeepUrlPath auth={auth} res={normalizedDirectory} pdh={pdh}/>,
593         collection: <KeepUrlBase auth={auth} res={normalizedDirectory} pdh={pdh}/>,
594     };
595 };
596
597 const fileToProcessIOValue = (file: File, auth: AuthState, pdh?: string): ProcessIOValue => {
598     return {
599         display: <KeepUrlPath auth={auth} res={file} pdh={pdh}/>,
600         imageUrl: isFileImage(file.basename) ? getImageUrl(auth, file, pdh) : undefined,
601         collection: <KeepUrlBase auth={auth} res={file} pdh={pdh}/>,
602     }
603 };
604
605 const EmptyValue = withStyles(styles)(
606     ({classes}: WithStyles<CssRules>) => <span className={classes.emptyValue}>No value</span>
607 );
608
609 const ImagePlaceholder = withStyles(styles)(
610     ({classes}: WithStyles<CssRules>) => <span className={classes.imagePlaceholder}><ImageIcon /></span>
611 );