@@ -2,7 +2,7 @@ import { type Interpolation, type Theme } from "@emotion/react";
2
2
import Button from "@mui/material/Button" ;
3
3
import AlertTitle from "@mui/material/AlertTitle" ;
4
4
import { type FC , useEffect , useState } from "react" ;
5
- import { useNavigate } from "react-router-dom" ;
5
+ import { useNavigate , Link as RouterLink } from "react-router-dom" ;
6
6
import dayjs from "dayjs" ;
7
7
import type * as TypesGen from "api/typesGenerated" ;
8
8
import { Alert , AlertDetail } from "components/Alert/Alert" ;
@@ -28,6 +28,28 @@ import {
28
28
import { BuildsTable } from "./BuildsTable" ;
29
29
import { WorkspaceDeletedBanner } from "./WorkspaceDeletedBanner" ;
30
30
import { WorkspaceStats } from "./WorkspaceStats" ;
31
+ import {
32
+ Topbar ,
33
+ TopbarAvatar ,
34
+ TopbarData ,
35
+ TopbarDivider ,
36
+ TopbarIcon ,
37
+ TopbarIconButton ,
38
+ } from "components/FullPageLayout/Topbar" ;
39
+ import Tooltip from "@mui/material/Tooltip" ;
40
+ import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined" ;
41
+ import { useTheme } from "@mui/material/styles" ;
42
+ import PersonOutlineOutlined from "@mui/icons-material/PersonOutlineOutlined" ;
43
+ import LayersOutlined from "@mui/icons-material/LayersOutlined" ;
44
+ import {
45
+ OutdatedTooltipContent ,
46
+ WorkspaceOutdatedTooltip ,
47
+ } from "components/WorkspaceOutdatedTooltip/WorkspaceOutdatedTooltip" ;
48
+ import {
49
+ Popover ,
50
+ PopoverContent ,
51
+ PopoverTrigger ,
52
+ } from "components/Popover/Popover" ;
31
53
32
54
export type WorkspaceError =
33
55
| "getBuildsError"
@@ -114,6 +136,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
114
136
hasMoreBuilds,
115
137
canAutostart,
116
138
} ) => {
139
+ const theme = useTheme ( ) ;
117
140
const navigate = useNavigate ( ) ;
118
141
const { saveLocal, getLocal } = useLocalStorage ( ) ;
119
142
@@ -166,7 +189,61 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
166
189
167
190
return (
168
191
< >
169
- < FullWidthPageHeader >
192
+ < Topbar >
193
+ < Tooltip title = "Back to workspaces" >
194
+ < TopbarIconButton component = { RouterLink } to = "workspaces" >
195
+ < ArrowBackOutlined />
196
+ </ TopbarIconButton >
197
+ </ Tooltip >
198
+
199
+ < div
200
+ css = { {
201
+ paddingLeft : 16 ,
202
+ display : "flex" ,
203
+ alignItems : "center" ,
204
+ gap : 32 ,
205
+ } }
206
+ >
207
+ < TopbarData >
208
+ < TopbarAvatar src = { workspace . template_icon } />
209
+ < span css = { { fontWeight : 500 } } > { workspace . name } </ span >
210
+ < TopbarDivider />
211
+ < span >
212
+ { workspace . template_display_name ?? workspace . template_name }
213
+ </ span >
214
+ < TopbarDivider />
215
+ { workspace . outdated ? (
216
+ < Popover mode = "hover" >
217
+ < PopoverTrigger >
218
+ < span css = { { color : theme . palette . warning . light } } >
219
+ { workspace . latest_build . template_version_name }
220
+ </ span >
221
+ </ PopoverTrigger >
222
+ < PopoverContent >
223
+ < OutdatedTooltipContent
224
+ templateName = { workspace . template_name }
225
+ latestVersionId = { workspace . template_active_version_id }
226
+ onUpdateVersion = { handleUpdate }
227
+ ariaLabel = "update version"
228
+ />
229
+ </ PopoverContent >
230
+ </ Popover >
231
+ ) : (
232
+ < span css = { { color : theme . palette . text . secondary } } >
233
+ { workspace . latest_build . template_version_name }
234
+ </ span >
235
+ ) }
236
+ </ TopbarData >
237
+
238
+ < TopbarData >
239
+ < TopbarIcon >
240
+ < PersonOutlineOutlined />
241
+ </ TopbarIcon >
242
+ < span > { workspace . owner_name } </ span >
243
+ </ TopbarData >
244
+ </ div >
245
+ </ Topbar >
246
+ { /* <FullWidthPageHeader>
170
247
<Stack direction="row" spacing={3} alignItems="center">
171
248
<Avatar
172
249
size="md"
@@ -214,7 +291,7 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
214
291
/>
215
292
</PageHeaderActions>
216
293
)}
217
- </ FullWidthPageHeader >
294
+ </FullWidthPageHeader> */ }
218
295
219
296
< Margins css = { styles . content } >
220
297
< Stack direction = "column" css = { styles . firstColumnSpacer } spacing = { 4 } >
0 commit comments