@@ -11,11 +11,8 @@ import {
11
11
} from "components/FullPageLayout/Topbar" ;
12
12
import Tooltip from "@mui/material/Tooltip" ;
13
13
import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined" ;
14
- import { WorkspaceOutdatedTooltipContent } from "components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip" ;
15
- import { Popover , PopoverTrigger } from "components/Popover/Popover" ;
16
14
import ScheduleOutlined from "@mui/icons-material/ScheduleOutlined" ;
17
15
import { WorkspaceStatusBadge } from "components/WorkspaceStatusBadge/WorkspaceStatusBadge" ;
18
- import { Pill } from "components/Pill/Pill" ;
19
16
import {
20
17
WorkspaceScheduleControls ,
21
18
shouldDisplayScheduleControls ,
@@ -24,12 +21,15 @@ import { workspaceQuota } from "api/queries/workspaceQuota";
24
21
import { useQuery } from "react-query" ;
25
22
import MonetizationOnOutlined from "@mui/icons-material/MonetizationOnOutlined" ;
26
23
import { useTheme } from "@mui/material/styles" ;
27
- import InfoOutlined from "@mui/icons-material/InfoOutlined" ;
28
24
import Link from "@mui/material/Link" ;
29
25
import { useDashboard } from "components/Dashboard/DashboardProvider" ;
30
26
import { displayDormantDeletion } from "utils/dormant" ;
31
27
import DeleteOutline from "@mui/icons-material/DeleteOutline" ;
32
28
import PersonOutline from "@mui/icons-material/PersonOutline" ;
29
+ import { Popover , PopoverTrigger } from "components/Popover/Popover" ;
30
+ import { HelpTooltipContent } from "components/HelpTooltip/HelpTooltip" ;
31
+ import { AvatarData } from "components/AvatarData/AvatarData" ;
32
+ import { Avatar } from "components/Avatar/Avatar" ;
33
33
34
34
export type WorkspaceError =
35
35
| "getBuildsError"
@@ -127,52 +127,70 @@ export const WorkspaceTopbar = (props: WorkspaceProps) => {
127
127
< span > { workspace . owner_name } </ span >
128
128
</ Tooltip >
129
129
< TopbarDivider />
130
- < Tooltip
131
- title = { workspace . template_display_name ?? workspace . template_name }
130
+ < Popover
131
+ mode = "hover"
132
+ // title={`${
133
+ // workspace.template_display_name ?? workspace.template_name
134
+ // } on version ${workspace.latest_build.template_version_name}` }
132
135
>
133
- < Link
134
- component = { RouterLink }
135
- to = { `/templates/${ workspace . template_name } ` }
136
- css = { { color : "inherit" } }
137
- >
138
- < TopbarAvatar src = { workspace . template_icon } />
139
- </ Link >
140
- </ Tooltip >
141
-
142
- < span css = { { fontWeight : 500 } } > { workspace . name } </ span >
136
+ < PopoverTrigger >
137
+ < span
138
+ css = { {
139
+ display : "flex" ,
140
+ alignItems : "center" ,
141
+ gap : 8 ,
142
+ cursor : "default" ,
143
+ padding : "4px 0" ,
144
+ } }
145
+ >
146
+ < TopbarAvatar src = { workspace . template_icon } />
147
+ < span css = { { fontWeight : 500 } } > { workspace . name } </ span >
148
+ </ span >
149
+ </ PopoverTrigger >
143
150
144
- { workspace . outdated ? (
145
- < Popover mode = "hover" >
146
- < PopoverTrigger >
147
- { /* Added to give some bottom space from the popover content */ }
148
- < div css = { { padding : "4px 0" , margin : "-4px 0" } } >
149
- < Pill
150
- icon = {
151
- < InfoOutlined
152
- css = { {
153
- width : "12px !important" ,
154
- height : "12px !important" ,
155
- color : theme . palette . warning . light ,
156
- } }
157
- />
158
- }
151
+ < HelpTooltipContent
152
+ anchorOrigin = { {
153
+ vertical : "bottom" ,
154
+ horizontal : "center" ,
155
+ } }
156
+ transformOrigin = { {
157
+ vertical : "top" ,
158
+ horizontal : "center" ,
159
+ } }
160
+ >
161
+ < AvatarData
162
+ title = {
163
+ < Link
164
+ component = { RouterLink }
165
+ to = { `/templates/${ workspace . template_name } ` }
166
+ css = { { color : "inherit" } }
167
+ >
168
+ { workspace . template_display_name . length > 0
169
+ ? workspace . template_display_name
170
+ : workspace . template_name }
171
+ </ Link >
172
+ }
173
+ subtitle = {
174
+ < Link
175
+ component = { RouterLink }
176
+ to = { `/templates/${ workspace . template_name } /versions/${ workspace . latest_build . template_version_name } ` }
177
+ css = { { color : "inherit" } }
159
178
>
160
- < span css = { { color : theme . palette . warning . light } } >
161
- { workspace . latest_build . template_version_name }
162
- </ span >
163
- </ Pill >
164
- </ div >
165
- </ PopoverTrigger >
166
- < WorkspaceOutdatedTooltipContent
167
- templateName = { workspace . template_name }
168
- latestVersionId = { workspace . template_active_version_id }
169
- onUpdateVersion = { handleUpdate }
170
- ariaLabel = "update version"
179
+ { workspace . latest_build . template_version_name }
180
+ </ Link >
181
+ }
182
+ avatar = {
183
+ workspace . template_icon !== "" && (
184
+ < Avatar
185
+ src = { workspace . template_icon }
186
+ variant = "square"
187
+ fitImage
188
+ />
189
+ )
190
+ }
171
191
/>
172
- </ Popover >
173
- ) : (
174
- < Pill > { workspace . latest_build . template_version_name } </ Pill >
175
- ) }
192
+ </ HelpTooltipContent >
193
+ </ Popover >
176
194
</ TopbarData >
177
195
178
196
{ shouldDisplayDormantData && (
0 commit comments