@@ -22,16 +22,26 @@ import { SideMenuItem } from "./SideMenuItem";
2222import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route" ;
2323import { Paragraph } from "../primitives/Paragraph" ;
2424import { 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+ } ;
2534
2635export function OrganizationSettingsSideMenu ( {
2736 organization,
28- version ,
37+ buildInfo ,
2938} : {
3039 organization : MatchedOrganization ;
31- version : string ;
40+ buildInfo : BuildInfo ;
3241} ) {
3342 const { isManagedCloud } = useFeatures ( ) ;
3443 const currentPlan = useCurrentPlan ( ) ;
44+ const isAdmin = useHasAdminAccess ( ) ;
3545
3646 return (
3747 < div
@@ -94,9 +104,33 @@ export function OrganizationSettingsSideMenu({
94104 < div className = "flex flex-col gap-1" >
95105 < SideMenuHeader title = "App version" />
96106 < Paragraph variant = "extra-small" className = "px-2 text-text-dimmed" >
97- v { version }
107+ { buildInfo . appVersion || `v ${ buildInfo . packageVersion } ` }
98108 </ Paragraph >
99109 </ 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+ ) }
100134 </ div >
101135 < div className = "flex flex-col gap-1 border-t border-grid-bright p-1" >
102136 < HelpAndFeedback />
0 commit comments