1
1
import Link from "@material-ui/core/Link"
2
2
import { makeStyles } from "@material-ui/core/styles"
3
- import React , { FC } from "react"
3
+ import ComputerIcon from "@material-ui/icons/Computer"
4
+ import { FC } from "react"
4
5
import * as TypesGen from "../../api/typesGenerated"
5
6
import { combineClasses } from "../../util/combineClasses"
6
7
7
8
export interface AppLinkProps {
8
9
userName : TypesGen . User [ "username" ]
9
10
workspaceName : TypesGen . Workspace [ "name" ]
10
11
appName : TypesGen . WorkspaceApp [ "name" ]
11
- appIcon : TypesGen . WorkspaceApp [ "icon" ]
12
+ appIcon ? : TypesGen . WorkspaceApp [ "icon" ]
12
13
}
13
14
14
15
export const AppLink : FC < AppLinkProps > = ( { userName, workspaceName, appName, appIcon } ) => {
@@ -25,11 +26,15 @@ export const AppLink: FC<AppLinkProps> = ({ userName, workspaceName, appName, ap
25
26
window . open ( href , appName , "width=900,height=600" )
26
27
} }
27
28
>
28
- < img
29
- className = { combineClasses ( [ styles . icon , appIcon === "" ? "empty" : "" ] ) }
30
- alt = { `${ appName } Icon` }
31
- src = { appIcon || "" }
32
- />
29
+ { appIcon ? (
30
+ < img
31
+ className = { combineClasses ( [ styles . icon , appIcon === "" ? "empty" : "" ] ) }
32
+ alt = { `${ appName } Icon` }
33
+ src = { appIcon || "" }
34
+ />
35
+ ) : (
36
+ < ComputerIcon className = { styles . icon } />
37
+ ) }
33
38
{ appName }
34
39
</ Link >
35
40
)
0 commit comments