File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
components/WorkspaceBuildStats Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { Stats , StatsItem } from "components/Stats/Stats"
2
2
import { FC } from "react"
3
+ import { useTranslation } from "react-i18next"
3
4
import { Link } from "react-router-dom"
4
5
import { WorkspaceBuild } from "../../api/typesGenerated"
5
6
import { displayWorkspaceBuildDuration } from "../../util/workspace"
@@ -11,25 +12,27 @@ export interface WorkspaceBuildStatsProps {
11
12
export const WorkspaceBuildStats : FC < WorkspaceBuildStatsProps > = ( {
12
13
build,
13
14
} ) => {
15
+ const { t } = useTranslation ( "buildPage" )
16
+
14
17
return (
15
18
< Stats >
16
19
< StatsItem
17
- label = "Workspace"
20
+ label = { t ( "stats.workspace" ) }
18
21
value = {
19
22
< Link to = { `/@${ build . workspace_owner_name } /${ build . workspace_name } ` } >
20
23
{ build . workspace_name }
21
24
</ Link >
22
25
}
23
26
/>
24
27
< StatsItem
25
- label = "Duration"
28
+ label = { t ( "stats.duration" ) }
26
29
value = { displayWorkspaceBuildDuration ( build ) }
27
30
/>
28
31
< StatsItem
29
- label = "Started at"
32
+ label = { t ( "stats.startedAt" ) }
30
33
value = { new Date ( build . created_at ) . toLocaleString ( ) }
31
34
/>
32
- < StatsItem label = "Action" value = { build . transition } />
35
+ < StatsItem label = { t ( "stats.action" ) } value = { build . transition } />
33
36
</ Stats >
34
37
)
35
38
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "stats" : {
3
+ "workspace" : " Workspace" ,
4
+ "duration" : " Duration" ,
5
+ "startedAt" : " Started at" ,
6
+ "action" : " Action"
7
+ }
8
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import templatePage from "./templatePage.json"
5
5
import templatesPage from "./templatesPage.json"
6
6
import workspacePage from "./workspacePage.json"
7
7
import agent from "./agent.json"
8
+ import buildPage from "./buildPage.json"
8
9
9
10
export const en = {
10
11
common,
@@ -14,4 +15,5 @@ export const en = {
14
15
templatesPage,
15
16
createWorkspacePage,
16
17
agent,
18
+ buildPage,
17
19
}
You can’t perform that action at this time.
0 commit comments