@@ -94,15 +94,11 @@ export type WorkspaceStatusBadgeProps = {
94
94
}
95
95
96
96
const ImpendingDeletionBadge : FC <
97
- PropsWithChildren < Partial < WorkspaceStatusBadgeProps > >
98
- > = ( { className } ) => {
99
- const { entitlements, experiments } = useDashboard ( )
100
- const allowAdvancedScheduling =
101
- entitlements . features [ "advanced_template_scheduling" ] . enabled
102
- // This check can be removed when https://github.com/coder/coder/milestone/19
103
- // is merged up
104
- const allowWorkspaceActions = experiments . includes ( "workspace_actions" )
105
-
97
+ Partial < WorkspaceStatusBadgeProps > & {
98
+ allowAdvancedScheduling : boolean
99
+ allowWorkspaceActions : boolean
100
+ }
101
+ > = ( { allowAdvancedScheduling, allowWorkspaceActions, className } ) => {
106
102
if ( ! allowAdvancedScheduling || ! allowWorkspaceActions ) {
107
103
return null
108
104
}
@@ -119,8 +115,21 @@ const ImpendingDeletionBadge: FC<
119
115
export const WorkspaceStatusBadge : FC <
120
116
PropsWithChildren < WorkspaceStatusBadgeProps >
121
117
> = ( { workspace, className } ) => {
118
+ const { entitlements, experiments } = useDashboard ( )
119
+ const allowAdvancedScheduling =
120
+ entitlements . features [ "advanced_template_scheduling" ] . enabled
121
+ // This check can be removed when https://github.com/coder/coder/milestone/19
122
+ // is merged up
123
+ const allowWorkspaceActions = experiments . includes ( "workspace_actions" )
124
+
122
125
if ( displayImpendingDeletion ( workspace ) ) {
123
- return < ImpendingDeletionBadge className = { className } />
126
+ return (
127
+ < ImpendingDeletionBadge
128
+ className = { className }
129
+ allowAdvancedScheduling = { allowAdvancedScheduling }
130
+ allowWorkspaceActions = { allowWorkspaceActions }
131
+ />
132
+ )
124
133
}
125
134
126
135
const { text, icon, type } = getStatus ( workspace . latest_build . status )
0 commit comments