Skip to content

Commit 3bb7605

Browse files
fix: Add resource icons into template page (coder#3124)
1 parent fa4361d commit 3bb7605

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

site/src/components/TemplateResourcesTable/TemplateResourcesTable.tsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import TableBody from "@material-ui/core/TableBody"
44
import TableCell from "@material-ui/core/TableCell"
55
import TableHead from "@material-ui/core/TableHead"
66
import TableRow from "@material-ui/core/TableRow"
7+
import { AvatarData } from "components/AvatarData/AvatarData"
8+
import { ResourceAvatar } from "components/Resources/ResourceAvatar"
79
import { FC } from "react"
810
import { WorkspaceResource } from "../../api/typesGenerated"
911
import { Stack } from "../Stack/Stack"
@@ -51,8 +53,12 @@ export const TemplateResourcesTable: FC<TemplateResourcesProps> = ({ resources }
5153
return (
5254
<TableRow>
5355
<TableCell className={styles.resourceNameCell}>
54-
{resource.name}
55-
<span className={styles.resourceType}>{resource.type}</span>
56+
<AvatarData
57+
title={resource.name}
58+
subtitle={resource.type}
59+
highlightTitle
60+
avatar={<ResourceAvatar type={resource.type} />}
61+
/>
5662
</TableCell>
5763
<TableCell colSpan={3}></TableCell>
5864
</TableRow>
@@ -65,8 +71,12 @@ export const TemplateResourcesTable: FC<TemplateResourcesProps> = ({ resources }
6571
{/* The rowspan should be the same than the number of agents */}
6672
{agentIndex === 0 && (
6773
<TableCell className={styles.resourceNameCell} rowSpan={agents.length}>
68-
{resource.name}
69-
<span className={styles.resourceType}>{resource.type}</span>
74+
<AvatarData
75+
title={resource.name}
76+
subtitle={resource.type}
77+
highlightTitle
78+
avatar={<ResourceAvatar type={resource.type} />}
79+
/>
7080
</TableCell>
7181
)}
7282

0 commit comments

Comments
 (0)