@@ -6,8 +6,6 @@ import { useActor } from "@xstate/react"
6
6
import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceStatusBadge"
7
7
import { FC } from "react"
8
8
import { useNavigate } from "react-router-dom"
9
- import { createDayString } from "util/createDayString"
10
- import { getDisplayWorkspaceBuildInitiatedBy } from "util/workspace"
11
9
import { WorkspaceItemMachineRef } from "../../xServices/workspaces/workspacesXService"
12
10
import { AvatarData } from "../AvatarData/AvatarData"
13
11
import {
@@ -29,8 +27,8 @@ export const WorkspacesRow: FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ w
29
27
const theme : Theme = useTheme ( )
30
28
const [ workspaceState , send ] = useActor ( workspaceRef )
31
29
const { data : workspace } = workspaceState . context
32
- const initiatedBy = getDisplayWorkspaceBuildInitiatedBy ( workspace . latest_build )
33
30
const workspacePageLink = `/@${ workspace . owner_name } /${ workspace . name } `
31
+ const hasTemplateIcon = workspace . template_icon && workspace . template_icon !== ""
34
32
35
33
return (
36
34
< TableRow
@@ -51,11 +49,17 @@ export const WorkspacesRow: FC<{ workspaceRef: WorkspaceItemMachineRef }> = ({ w
51
49
</ TableCellData >
52
50
</ TableCellLink >
53
51
54
- < TableCellLink to = { workspacePageLink } > { workspace . template_name } </ TableCellLink >
55
52
< TableCellLink to = { workspacePageLink } >
56
53
< AvatarData
57
- title = { initiatedBy }
58
- subtitle = { createDayString ( workspace . latest_build . created_at ) }
54
+ title = { workspace . template_name }
55
+ highlightTitle = { false }
56
+ avatar = {
57
+ hasTemplateIcon ? (
58
+ < div className = { styles . templateIconWrapper } >
59
+ < img alt = "" src = { workspace . template_icon } />
60
+ </ div >
61
+ ) : undefined
62
+ }
59
63
/>
60
64
</ TableCellLink >
61
65
< TableCellLink to = { workspacePageLink } >
@@ -117,4 +121,14 @@ const useStyles = makeStyles((theme) => ({
117
121
color : theme . palette . text . secondary ,
118
122
fontSize : 12 ,
119
123
} ,
124
+ templateIconWrapper : {
125
+ // Same size then the avatar component
126
+ width : 36 ,
127
+ height : 36 ,
128
+ padding : 2 ,
129
+
130
+ "& img" : {
131
+ width : "100%" ,
132
+ } ,
133
+ } ,
120
134
} ) )
0 commit comments