@@ -68,52 +68,54 @@ const TasksPage: FC = () => {
6868error = { aiTemplatesQuery . error }
6969onRetry = { aiTemplatesQuery . refetch }
7070/>
71- { aiTemplatesQuery . isSuccess && (
72- < section className = "py-8" >
73- { permissions . viewDeploymentConfig && (
74- < section
75- className = "mt-6 flex justify-between"
76- aria-label = "Controls"
77- >
78- < div className = "flex items-center bg-surface-secondary rounded p-1" >
79- < PillButton
80- active = { tab . value === "all" }
81- onClick = { ( ) => tab . setValue ( "all" ) }
82- >
83- All tasks
84- </ PillButton >
85- < PillButton
86- disabled = { ! idleTasks || idleTasks . length === 0 }
87- active = { tab . value === "waiting-for-input" }
88- onClick = { ( ) => tab . setValue ( "waiting-for-input" ) }
89- >
90- Waiting for input
91- { idleTasks && idleTasks . length > 0 && (
92- < Badge className = "-mr-0.5" size = "xs" variant = "info" >
93- { idleTasks . length }
94- </ Badge >
95- ) }
96- </ PillButton >
97- </ div >
71+ { aiTemplatesQuery . isSuccess &&
72+ aiTemplatesQuery . data &&
73+ aiTemplatesQuery . data . length > 0 && (
74+ < section className = "py-8" >
75+ { permissions . viewDeploymentConfig && (
76+ < section
77+ className = "mt-6 flex justify-between"
78+ aria-label = "Controls"
79+ >
80+ < div className = "flex items-center bg-surface-secondary rounded p-1" >
81+ < PillButton
82+ active = { tab . value === "all" }
83+ onClick = { ( ) => tab . setValue ( "all" ) }
84+ >
85+ All tasks
86+ </ PillButton >
87+ < PillButton
88+ disabled = { ! idleTasks || idleTasks . length === 0 }
89+ active = { tab . value === "waiting-for-input" }
90+ onClick = { ( ) => tab . setValue ( "waiting-for-input" ) }
91+ >
92+ Waiting for input
93+ { idleTasks && idleTasks . length > 0 && (
94+ < Badge className = "-mr-0.5" size = "xs" variant = "info" >
95+ { idleTasks . length }
96+ </ Badge >
97+ ) }
98+ </ PillButton >
99+ </ div >
98100
99- < UsersCombobox
100- value = { ownerFilter . value }
101- onValueChange = { ( username ) => {
102- ownerFilter . setValue (
103- username === ownerFilter . value ?"" :username ,
104- ) ;
105- } }
106- />
107- </ section >
108- ) }
101+ < UsersCombobox
102+ value = { ownerFilter . value }
103+ onValueChange = { ( username ) => {
104+ ownerFilter . setValue (
105+ username === ownerFilter . value ?"" :username ,
106+ ) ;
107+ } }
108+ />
109+ </ section >
110+ ) }
109111
110- < TasksTable
111- tasks = { displayedTasks }
112- error = { tasksQuery . error }
113- onRetry = { tasksQuery . refetch }
114- />
115- </ section >
116- ) }
112+ < TasksTable
113+ tasks = { displayedTasks }
114+ error = { tasksQuery . error }
115+ onRetry = { tasksQuery . refetch }
116+ />
117+ </ section >
118+ ) }
117119</ main >
118120</ Margins >
119121</ >