@@ -22,16 +22,26 @@ import { SideMenuItem } from "./SideMenuItem";
22
22
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route" ;
23
23
import { Paragraph } from "../primitives/Paragraph" ;
24
24
import { Badge } from "../primitives/Badge" ;
25
+ import { useHasAdminAccess } from "~/hooks/useUser" ;
26
+
27
+ export type BuildInfo = {
28
+ appVersion : string | undefined ;
29
+ packageVersion : string ;
30
+ buildTimestampSeonds : string | undefined ;
31
+ gitSha : string | undefined ;
32
+ gitRefName : string | undefined ;
33
+ } ;
25
34
26
35
export function OrganizationSettingsSideMenu ( {
27
36
organization,
28
- version ,
37
+ buildInfo ,
29
38
} : {
30
39
organization : MatchedOrganization ;
31
- version : string ;
40
+ buildInfo : BuildInfo ;
32
41
} ) {
33
42
const { isManagedCloud } = useFeatures ( ) ;
34
43
const currentPlan = useCurrentPlan ( ) ;
44
+ const isAdmin = useHasAdminAccess ( ) ;
35
45
36
46
return (
37
47
< div
@@ -94,9 +104,33 @@ export function OrganizationSettingsSideMenu({
94
104
< div className = "flex flex-col gap-1" >
95
105
< SideMenuHeader title = "App version" />
96
106
< Paragraph variant = "extra-small" className = "px-2 text-text-dimmed" >
97
- v { version }
107
+ { buildInfo . appVersion || `v ${ buildInfo . packageVersion } ` }
98
108
</ Paragraph >
99
109
</ div >
110
+ { isAdmin && buildInfo . buildTimestampSeonds && (
111
+ < div className = "flex flex-col gap-1" >
112
+ < SideMenuHeader title = "Build timestamp" />
113
+ < Paragraph variant = "extra-small" className = "px-2 text-text-dimmed" >
114
+ { new Date ( Number ( buildInfo . buildTimestampSeonds ) * 1000 ) . toISOString ( ) }
115
+ </ Paragraph >
116
+ </ div >
117
+ ) }
118
+ { isAdmin && buildInfo . gitRefName && (
119
+ < div className = "flex flex-col gap-1" >
120
+ < SideMenuHeader title = "Git ref" />
121
+ < Paragraph variant = "extra-small" className = "px-2 text-text-dimmed" >
122
+ { buildInfo . gitRefName }
123
+ </ Paragraph >
124
+ </ div >
125
+ ) }
126
+ { isAdmin && buildInfo . gitSha && (
127
+ < div className = "flex flex-col gap-1" >
128
+ < SideMenuHeader title = "Git sha" />
129
+ < Paragraph variant = "extra-small" className = "px-2 text-text-dimmed" >
130
+ { buildInfo . gitSha . slice ( 0 , 9 ) }
131
+ </ Paragraph >
132
+ </ div >
133
+ ) }
100
134
</ div >
101
135
< div className = "flex flex-col gap-1 border-t border-grid-bright p-1" >
102
136
< HelpAndFeedback />
0 commit comments