@@ -10,16 +10,15 @@ import { useParams } from 'next/navigation';
1010import { MdArrowDropDown } from 'react-icons/md' ;
1111
1212import Button from '@/components/button/button' ;
13+ import useConfigValue from '@/hooks/use-config-value/use-config-value' ;
1314import { type SchedulePageLayoutParams } from '@/views/schedule-page/schedule-page.types' ;
1415import useDescribeSchedule from '@/views/shared/hooks/use-describe-schedule/use-describe-schedule' ;
1516
17+ import { type SelectableScheduleAction } from './config/schedule-actions.config' ;
1618import ScheduleActionsMenu from './schedule-actions-menu/schedule-actions-menu' ;
1719import ScheduleActionsModal from './schedule-actions-modal/schedule-actions-modal' ;
1820import { overrides } from './schedule-actions.styles' ;
19- import { type SelectableScheduleAction } from './config/schedule-actions.config' ;
20- import {
21- type ErasedScheduleAction ,
22- } from './schedule-actions.types' ;
21+ import { type ErasedScheduleAction } from './schedule-actions.types' ;
2322
2423export default function ScheduleActions ( ) {
2524 const params = useParams < SchedulePageLayoutParams > ( ) ;
@@ -33,6 +32,12 @@ export default function ScheduleActions() {
3332 ...scheduleDetailsParams ,
3433 } ) ;
3534
35+ const { data : actionsEnabledConfig , isLoading : isActionsEnabledLoading } =
36+ useConfigValue ( 'SCHEDULE_ACTIONS_ENABLED' , {
37+ domain : params . domain ,
38+ cluster : params . cluster ,
39+ } ) ;
40+
3641 const [ selectedAction , setSelectedAction ] = useState <
3742 SelectableScheduleAction | undefined
3843 > ( undefined ) ;
@@ -49,6 +54,7 @@ export default function ScheduleActions() {
4954 content = { ( { close } ) => (
5055 < ScheduleActionsMenu
5156 schedule = { schedule }
57+ actionsEnabledConfig = { actionsEnabledConfig }
5258 onActionSelect = { ( action ) => {
5359 setSelectedAction ( action ) ;
5460 close ( ) ;
@@ -63,7 +69,7 @@ export default function ScheduleActions() {
6369 kind = "secondary"
6470 endEnhancer = { < MdArrowDropDown size = { 20 } /> }
6571 loadingIndicatorType = "skeleton"
66- isLoading = { isScheduleLoading }
72+ isLoading = { isScheduleLoading || isActionsEnabledLoading }
6773 >
6874 Schedule Actions
6975 </ Button >
0 commit comments