Skip to content

fix: Add resource icons into template page #3124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import TableBody from "@material-ui/core/TableBody"
import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import { AvatarData } from "components/AvatarData/AvatarData"
import { ResourceAvatar } from "components/Resources/ResourceAvatar"
import { FC } from "react"
import { WorkspaceResource } from "../../api/typesGenerated"
import { Stack } from "../Stack/Stack"
Expand Down Expand Up @@ -51,8 +53,12 @@ export const TemplateResourcesTable: FC<TemplateResourcesProps> = ({ resources }
return (
<TableRow>
<TableCell className={styles.resourceNameCell}>
{resource.name}
<span className={styles.resourceType}>{resource.type}</span>
<AvatarData
title={resource.name}
subtitle={resource.type}
highlightTitle
avatar={<ResourceAvatar type={resource.type} />}
/>
</TableCell>
<TableCell colSpan={3}></TableCell>
</TableRow>
Expand All @@ -65,8 +71,12 @@ export const TemplateResourcesTable: FC<TemplateResourcesProps> = ({ resources }
{/* The rowspan should be the same than the number of agents */}
{agentIndex === 0 && (
<TableCell className={styles.resourceNameCell} rowSpan={agents.length}>
{resource.name}
<span className={styles.resourceType}>{resource.type}</span>
<AvatarData
title={resource.name}
subtitle={resource.type}
highlightTitle
avatar={<ResourceAvatar type={resource.type} />}
/>
</TableCell>
)}

Expand Down