@@ -4,7 +4,9 @@ import TableBody from "@material-ui/core/TableBody"
4
4
import TableCell from "@material-ui/core/TableCell"
5
5
import TableHead from "@material-ui/core/TableHead"
6
6
import TableRow from "@material-ui/core/TableRow"
7
+ import MemoryIcon from "@material-ui/icons/MemoryOutlined"
7
8
import useTheme from "@material-ui/styles/useTheme"
9
+ import { AvatarData } from "components/AvatarData/AvatarData"
8
10
import { FC } from "react"
9
11
import { Workspace , WorkspaceResource } from "../../api/typesGenerated"
10
12
import { getDisplayAgentStatus } from "../../util/workspace"
@@ -68,17 +70,23 @@ export const Resources: FC<ResourcesProps> = ({
68
70
/* We need to initialize the agents to display the resource */
69
71
}
70
72
const agents = resource . agents ?? [ null ]
73
+ const resourceName = (
74
+ < AvatarData
75
+ avatar = { < MemoryIcon /> }
76
+ title = { resource . name }
77
+ subtitle = { resource . type }
78
+ highlightTitle
79
+ />
80
+ )
81
+
71
82
return agents . map ( ( agent , agentIndex ) => {
72
83
{
73
84
/* If there is no agent, just display the resource name */
74
85
}
75
86
if ( ! agent ) {
76
87
return (
77
88
< TableRow key = { `${ resource . id } -${ agentIndex } ` } >
78
- < TableCell >
79
- { resource . name }
80
- < span className = { styles . resourceType } > { resource . type } </ span >
81
- </ TableCell >
89
+ < TableCell > { resourceName } </ TableCell >
82
90
< TableCell colSpan = { 3 } > </ TableCell >
83
91
</ TableRow >
84
92
)
@@ -91,8 +99,7 @@ export const Resources: FC<ResourcesProps> = ({
91
99
{ /* The rowspan should be the same than the number of agents */ }
92
100
{ agentIndex === 0 && (
93
101
< TableCell className = { styles . resourceNameCell } rowSpan = { agents . length } >
94
- { resource . name }
95
- < span className = { styles . resourceType } > { resource . type } </ span >
102
+ { resourceName }
96
103
</ TableCell >
97
104
) }
98
105
0 commit comments