16073: Update process io panel cypress tests
[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, InvisibleIcon, OutputIcon, VisibleIcon } 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 ? <VisibleIcon /> : <InvisibleIcon />}</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                             <Tabs value={mainProcTabState} onChange={handleMainProcTabChange} variant="fullWidth" className={classes.symmetricTabs}>
229                                 <Tab label="Parameters" />
230                                 <Tab label="JSON" />
231                             </Tabs>
232                             {mainProcTabState === 0 && <div className={classes.tableWrapper}>
233                                 {params.length ?
234                                     <ProcessIOPreview data={params} showImagePreview={showImagePreview} /> :
235                                     <Grid container item alignItems='center' justify='center'>
236                                         <DefaultView messages={["No parameters found"]} icon={InfoIcon} />
237                                     </Grid>}
238                                 </div>}
239                             {mainProcTabState === 1 && <div className={classes.tableWrapper}>
240                                 {params.length ?
241                                     <ProcessIORaw data={raw || params} /> :
242                                     <Grid container item alignItems='center' justify='center'>
243                                         <DefaultView messages={["No parameters found"]} icon={InfoIcon} />
244                                     </Grid>}
245                                 </div>}
246                         </>) :
247                         (<>
248                             <Tabs value={0} variant="fullWidth" className={classes.symmetricTabs}>
249                                 {label === ProcessIOCardType.INPUT && <Tab label="Collections" />}
250                                 {label === ProcessIOCardType.OUTPUT && <Tab label="Collection" />}
251                             </Tabs>
252                             <div className={classes.tableWrapper}>
253                                 {label === ProcessIOCardType.INPUT && <ProcessInputMounts mounts={mounts || []} />}
254                                 {label === ProcessIOCardType.OUTPUT && <>
255                                     {outputUuid && <Typography className={classes.collectionLink}>
256                                         Output Collection: <MuiLink className={classes.keepLink} onClick={() => {navigateTo(outputUuid)}}>
257                                         {outputUuid}
258                                     </MuiLink></Typography>}
259                                     <ProcessOutputCollectionFiles isWritable={false} currentItemUuid={outputUuid} />
260                                 </>}
261                             </div>
262                         </>)
263                     }
264                 </div>
265             </CardContent>
266         </Card>;
267     }
268 ));
269
270 export type ProcessIOValue = {
271     display: ReactElement<any, any>;
272     imageUrl?: string;
273     collection?: ReactElement<any, any>;
274 }
275
276 export type ProcessIOParameter = {
277     id: string;
278     label: string;
279     doc: string;
280     value: ProcessIOValue[];
281 }
282
283 interface ProcessIOPreviewDataProps {
284     data: ProcessIOParameter[];
285     showImagePreview: boolean;
286 }
287
288 type ProcessIOPreviewProps = ProcessIOPreviewDataProps & WithStyles<CssRules>;
289
290 const ProcessIOPreview = withStyles(styles)(
291     ({ classes, data, showImagePreview }: ProcessIOPreviewProps) =>
292         <Table className={classes.tableRoot} aria-label="Process IO Preview">
293             <TableHead>
294                 <TableRow>
295                     <TableCell>Name</TableCell>
296                     <TableCell>Label</TableCell>
297                     <TableCell>Description</TableCell>
298                     <TableCell>Value</TableCell>
299                     <TableCell>Collection</TableCell>
300                 </TableRow>
301             </TableHead>
302             <TableBody>
303                 {data.map((param: ProcessIOParameter) => {
304                     const firstVal = param.value.length > 0 ? param.value[0] : undefined;
305                     const rest = param.value.slice(1);
306                     const rowClass = rest.length > 0 ? classes.halfRow : undefined;
307
308                     return <>
309                         <TableRow className={rowClass} data-cy="process-io-param">
310                             <TableCell>
311                                 {param.id}
312                             </TableCell>
313                             <TableCell >{param.label}</TableCell>
314                             <TableCell >{param.doc}</TableCell>
315                             <TableCell>
316                                 {firstVal && <ProcessValuePreview value={firstVal} showImagePreview={showImagePreview} />}
317                             </TableCell>
318                             <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
319                                 <Typography className={classes.paramValue}>
320                                     {firstVal?.collection}
321                                 </Typography>
322                             </TableCell>
323                         </TableRow>
324                         {rest.map((val, i) => (
325                             <TableRow className={(i < rest.length-1) ? rowClass : undefined}>
326                                 <TableCell />
327                                 <TableCell />
328                                 <TableCell />
329                                 <TableCell>
330                                     <ProcessValuePreview value={val} showImagePreview={showImagePreview} />
331                                 </TableCell>
332                                 <TableCell className={firstVal?.imageUrl ? classes.rowWithPreview : undefined}>
333                                     <Typography className={classes.paramValue}>
334                                         {val.collection}
335                                     </Typography>
336                                 </TableCell>
337                             </TableRow>
338                         ))}
339                     </>;
340                 })}
341             </TableBody>
342         </Table>
343 );
344
345 interface ProcessValuePreviewProps {
346     value: ProcessIOValue;
347     showImagePreview: boolean;
348 }
349
350 const ProcessValuePreview = withStyles(styles)(
351     ({value, showImagePreview, classes}: ProcessValuePreviewProps & WithStyles<CssRules>) =>
352         <Typography className={classes.paramValue}>
353             {value.imageUrl && showImagePreview ? <img className={classes.imagePreview} src={value.imageUrl} alt="Inline Preview" /> : ""}
354             {value.imageUrl && !showImagePreview ? <ImagePlaceholder /> : ""}
355             <span className={classes.valArray}>
356                 {value.display}
357             </span>
358         </Typography>
359 )
360
361 const handleClick = (url) => {
362     window.open(url, '_blank');
363 }
364
365
366 interface ProcessIORawDataProps {
367     data: ProcessIOParameter[];
368 }
369
370 const ProcessIORaw = withStyles(styles)(
371     ({ data }: ProcessIORawDataProps) =>
372         <Paper elevation={0}>
373             <pre>
374                 {JSON.stringify(data, null, 2)}
375             </pre>
376         </Paper>
377 );
378
379 interface ProcessInputMountsDataProps {
380     mounts: InputCollectionMount[];
381 }
382
383 type ProcessInputMountsProps = ProcessInputMountsDataProps & WithStyles<CssRules>;
384
385 const ProcessInputMounts = withStyles(styles)(connect((state: RootState) => ({
386     auth: state.auth,
387 }))(({ mounts, classes, auth }: ProcessInputMountsProps & { auth: AuthState }) => (
388     <Table className={classes.tableRoot} aria-label="Process Input Mounts">
389         <TableHead>
390             <TableRow>
391                 <TableCell>Path</TableCell>
392                 <TableCell>Portable Data Hash</TableCell>
393             </TableRow>
394         </TableHead>
395         <TableBody>
396             {mounts.map(mount => (
397                 <TableRow key={mount.path}>
398                     <TableCell><pre>{mount.path}</pre></TableCell>
399                     <TableCell>
400                         <RouterLink to={getNavUrl(mount.pdh, auth)} className={classes.keepLink}>{mount.pdh}</RouterLink>
401                     </TableCell>
402                 </TableRow>
403             ))}
404         </TableBody>
405     </Table>
406 )));
407
408 type FileWithSecondaryFiles = {
409     secondaryFiles: File[];
410 }
411
412 export const getIOParamDisplayValue = (auth: AuthState, input: CommandInputParameter | CommandOutputParameter, pdh?: string): ProcessIOValue[] => {
413     switch (true) {
414         case isPrimitiveOfType(input, CWLType.BOOLEAN):
415             const boolValue = (input as BooleanCommandInputParameter).value;
416
417             return boolValue !== undefined &&
418                     !(Array.isArray(boolValue) && boolValue.length === 0) ?
419                 [{display: <pre>{String(boolValue)}</pre> }] :
420                 [{display: <EmptyValue />}];
421
422         case isPrimitiveOfType(input, CWLType.INT):
423         case isPrimitiveOfType(input, CWLType.LONG):
424             const intValue = (input as IntCommandInputParameter).value;
425
426             return intValue !== undefined &&
427                     // Missing values are empty array
428                     !(Array.isArray(intValue) && intValue.length === 0) ?
429                 [{display: <pre>{String(intValue)}</pre> }]
430                 : [{display: <EmptyValue />}];
431
432         case isPrimitiveOfType(input, CWLType.FLOAT):
433         case isPrimitiveOfType(input, CWLType.DOUBLE):
434             const floatValue = (input as FloatCommandInputParameter).value;
435
436             return floatValue !== undefined &&
437                     !(Array.isArray(floatValue) && floatValue.length === 0) ?
438                 [{display: <pre>{String(floatValue)}</pre> }]:
439                 [{display: <EmptyValue />}];
440
441         case isPrimitiveOfType(input, CWLType.STRING):
442             const stringValue = (input as StringCommandInputParameter).value || undefined;
443
444             return stringValue !== undefined &&
445                     !(Array.isArray(stringValue) && stringValue.length === 0) ?
446                 [{display: <pre>{stringValue}</pre> }] :
447                 [{display: <EmptyValue />}];
448
449         case isPrimitiveOfType(input, CWLType.FILE):
450             const mainFile = (input as FileCommandInputParameter).value;
451             // secondaryFiles: File[] is not part of CommandOutputParameter so we cast to access secondaryFiles
452             const secondaryFiles = ((mainFile as unknown) as FileWithSecondaryFiles)?.secondaryFiles || [];
453             const files = [
454                 ...(mainFile && !(Array.isArray(mainFile) && mainFile.length === 0) ? [mainFile] : []),
455                 ...secondaryFiles
456             ];
457
458             return files.length ?
459                 files.map(file => fileToProcessIOValue(file, auth, pdh)) :
460                 [{display: <EmptyValue />}];
461
462         case isPrimitiveOfType(input, CWLType.DIRECTORY):
463             const directory = (input as DirectoryCommandInputParameter).value;
464
465             return directory !== undefined &&
466                     !(Array.isArray(directory) && directory.length === 0) ?
467                 [directoryToProcessIOValue(directory, auth, pdh)] :
468                 [{display: <EmptyValue />}];
469
470         case typeof input.type === 'object' &&
471             !(input.type instanceof Array) &&
472             input.type.type === 'enum':
473             const enumValue = (input as EnumCommandInputParameter).value;
474
475             return enumValue !== undefined ?
476                 [{ display: <pre>{(input as EnumCommandInputParameter).value || ''}</pre> }] :
477                 [{display: <EmptyValue />}];
478
479         case isArrayOfType(input, CWLType.STRING):
480             const strArray = (input as StringArrayCommandInputParameter).value || [];
481             return strArray.length ?
482                 [{ display: <>{((input as StringArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
483                 [{display: <EmptyValue />}];
484
485         case isArrayOfType(input, CWLType.INT):
486         case isArrayOfType(input, CWLType.LONG):
487             const intArray = (input as IntArrayCommandInputParameter).value || [];
488
489             return intArray.length ?
490                 [{ display: <>{((input as IntArrayCommandInputParameter).value || []).map((val) => <Chip label={val} />)}</> }] :
491                 [{display: <EmptyValue />}];
492
493         case isArrayOfType(input, CWLType.FLOAT):
494         case isArrayOfType(input, CWLType.DOUBLE):
495             const floatArray = (input as FloatArrayCommandInputParameter).value || [];
496
497             return floatArray.length ?
498                 [{ display: <>{floatArray.map((val) => <Chip label={val} />)}</> }] :
499                 [{display: <EmptyValue />}];
500
501         case isArrayOfType(input, CWLType.FILE):
502             const fileArrayMainFile = ((input as FileArrayCommandInputParameter).value || []);
503             const fileArraySecondaryFiles = fileArrayMainFile.map((file) => (
504                 ((file as unknown) as FileWithSecondaryFiles)?.secondaryFiles || []
505             )).reduce((acc: File[], params: File[]) => (acc.concat(params)), []);
506
507             const fileArrayFiles = [
508                 ...fileArrayMainFile,
509                 ...fileArraySecondaryFiles
510             ];
511
512             return fileArrayFiles.length ?
513                 fileArrayFiles.map(file => fileToProcessIOValue(file, auth, pdh)) :
514                 [{display: <EmptyValue />}];
515
516         case isArrayOfType(input, CWLType.DIRECTORY):
517             const directories = (input as DirectoryArrayCommandInputParameter).value || [];
518
519             return directories.length ?
520                 directories.map(directory => directoryToProcessIOValue(directory, auth, pdh)) :
521                 [{display: <EmptyValue />}];
522
523         default:
524             return [];
525     }
526 };
527
528 const getKeepUrl = (file: File | Directory, pdh?: string): string => {
529     const isKeepUrl = file.location?.startsWith('keep:') || false;
530     const keepUrl = isKeepUrl ? file.location : pdh ? `keep:${pdh}/${file.location}` : file.location;
531     return keepUrl || '';
532 };
533
534 interface KeepUrlProps {
535     auth: AuthState;
536     res: File | Directory;
537     pdh?: string;
538 }
539
540 const KeepUrlBase = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
541     const keepUrl = getKeepUrl(res, pdh);
542     const pdhUrl = keepUrl ? keepUrl.split('/').slice(0, 1)[0] : '';
543     // Passing a pdh always returns a relative wb2 collection url
544     const pdhWbPath = getNavUrl(pdhUrl.replace('keep:', ''), auth);
545     return pdhUrl && pdhWbPath ?
546         <Tooltip title={"View collection in Workbench"}><RouterLink to={pdhWbPath} className={classes.keepLink}>{pdhUrl}</RouterLink></Tooltip> :
547         <></>;
548 });
549
550 const KeepUrlPath = withStyles(styles)(({auth, res, pdh, classes}: KeepUrlProps & WithStyles<CssRules>) => {
551     const keepUrl = getKeepUrl(res, pdh);
552     const keepUrlParts = keepUrl ? keepUrl.split('/') : [];
553     const keepUrlPath = keepUrlParts.length > 1 ? keepUrlParts.slice(1).join('/') : '';
554
555     const keepUrlPathNav = getKeepNavUrl(auth, res, pdh);
556     return keepUrlPath && keepUrlPathNav ?
557         <Tooltip title={"View in keep-web"}><MuiLink className={classes.keepLink} onClick={() => handleClick(keepUrlPathNav)}>{keepUrlPath}</MuiLink></Tooltip> :
558         // Show No value for root collection io that lacks path part
559         <EmptyValue />;
560 });
561
562 const getKeepNavUrl = (auth: AuthState, file: File | Directory, pdh?: string): string => {
563     let keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
564     return (getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl));
565 };
566
567 const getImageUrl = (auth: AuthState, file: File, pdh?: string): string => {
568     const keepUrl = getKeepUrl(file, pdh).replace('keep:', '');
569     return getInlineFileUrl(`${auth.config.keepWebServiceUrl}/c=${keepUrl}?api_token=${auth.apiToken}`, auth.config.keepWebServiceUrl, auth.config.keepWebInlineServiceUrl);
570 };
571
572 const isFileImage = (basename?: string): boolean => {
573     return basename ? (mime.getType(basename) || "").startsWith('image/') : false;
574 };
575
576 const normalizeDirectoryLocation = (directory: Directory): Directory => {
577     if (!directory.location) {
578         return directory;
579     }
580     return {
581         ...directory,
582         location: (directory.location || '').endsWith('/') ? directory.location : directory.location + '/',
583     };
584 };
585
586 const directoryToProcessIOValue = (directory: Directory, auth: AuthState, pdh?: string): ProcessIOValue => {
587     const normalizedDirectory = normalizeDirectoryLocation(directory);
588     return {
589         display: <KeepUrlPath auth={auth} res={normalizedDirectory} pdh={pdh}/>,
590         collection: <KeepUrlBase auth={auth} res={normalizedDirectory} pdh={pdh}/>,
591     };
592 };
593
594 const fileToProcessIOValue = (file: File, auth: AuthState, pdh?: string): ProcessIOValue => {
595     return {
596         display: <KeepUrlPath auth={auth} res={file} pdh={pdh}/>,
597         imageUrl: isFileImage(file.basename) ? getImageUrl(auth, file, pdh) : undefined,
598         collection: <KeepUrlBase auth={auth} res={file} pdh={pdh}/>,
599     }
600 };
601
602 const EmptyValue = withStyles(styles)(
603     ({classes}: WithStyles<CssRules>) => <span className={classes.emptyValue}>No value</span>
604 );
605
606 const ImagePlaceholder = withStyles(styles)(
607     ({classes}: WithStyles<CssRules>) => <span className={classes.imagePlaceholder}><ImageIcon /></span>
608 );