@@ -6,8 +6,9 @@ import { ArrowDown } from 'lucide-react';
66import { ChatView } from '@/components/primary-content/chat-view' ;
77import { HomeView } from '@/components/primary-content/home-view' ;
88import { PromptInput } from '@/components/primary-content/prompt-input' ;
9+ import { ScheduledTasksPage } from '@/components/scheduled-tasks/scheduled-tasks-page' ;
910import { IconButton } from '@/components/ui/icon-button' ;
10- import { useSafeSearchParams } from '@/hooks/use-safe-search-params' ;
11+ import { AppView , useSafeSearchParams } from '@/hooks/use-safe-search-params' ;
1112
1213type ContentAreaProps = {
1314 isTracesSidebarOpen : boolean ;
@@ -18,7 +19,8 @@ export function PrimaryContent({
1819 isTracesSidebarOpen,
1920 toggleTracesSidebar,
2021} : ContentAreaProps ) {
21- const { taskID } = useSafeSearchParams ( ) ;
22+ const { taskID, view } = useSafeSearchParams ( ) ;
23+ const isScheduledTasksView = view === AppView . SCHEDULED_TASKS ;
2224
2325 const [ prompt , setPrompt ] = useState < string > ( '' ) ;
2426 const [ showScrollButton , setShowScrollButton ] = useState ( false ) ;
@@ -56,20 +58,24 @@ export function PrimaryContent({
5658 } , [ scrollContainerRef ] ) ;
5759
5860 useEffect ( ( ) => {
59- if ( scrollContainerRef . current && taskID ) {
61+ if ( scrollContainerRef . current && taskID && ! isScheduledTasksView ) {
6062 setTimeout ( ( ) => {
6163 scrollToBottom ( ) ;
6264 } , 150 ) ;
6365 }
64- } , [ scrollToBottom , taskID ] ) ;
66+ } , [ scrollToBottom , taskID , isScheduledTasksView ] ) ;
6567
6668 return (
6769 < motion . div
6870 layout
69- className = { `relative flex h-full flex-1 flex-col ${ ! taskID ? 'justify-center' : 'justify-between' } ` }
71+ className = { `relative flex h-full flex-1 flex-col ${
72+ ! taskID && ! isScheduledTasksView ? 'justify-center' : 'justify-between'
73+ } `}
7074 transition = { { duration : 0.25 , ease : 'easeInOut' } }
7175 >
72- { taskID ? (
76+ { isScheduledTasksView ? (
77+ < ScheduledTasksPage />
78+ ) : taskID ? (
7379 < ChatView
7480 taskID = { taskID }
7581 isTracesSidebarOpen = { isTracesSidebarOpen }
@@ -81,26 +87,28 @@ export function PrimaryContent({
8187 < HomeView />
8288 ) }
8389
84- < motion . div
85- layout = "position"
86- className = "relative flex w-full justify-center px-4 py-4 sm:px-6 md:px-8"
87- transition = { {
88- layout : {
89- type : 'spring' ,
90- damping : 40 ,
91- stiffness : 300 ,
92- mass : 0.8 ,
93- } ,
94- } }
95- >
96- < AnimatePresence >
97- { taskID && showScrollButton && (
98- < ScrollToBottomButton scrollToBottom = { scrollToBottom } />
99- ) }
100- </ AnimatePresence >
101-
102- < PromptInput prompt = { prompt } setPrompt = { setPrompt } />
103- </ motion . div >
90+ { ! isScheduledTasksView && (
91+ < motion . div
92+ layout = "position"
93+ className = "relative flex w-full justify-center px-4 py-4 sm:px-6 md:px-8"
94+ transition = { {
95+ layout : {
96+ type : 'spring' ,
97+ damping : 40 ,
98+ stiffness : 300 ,
99+ mass : 0.8 ,
100+ } ,
101+ } }
102+ >
103+ < AnimatePresence >
104+ { taskID && showScrollButton && (
105+ < ScrollToBottomButton scrollToBottom = { scrollToBottom } />
106+ ) }
107+ </ AnimatePresence >
108+
109+ < PromptInput prompt = { prompt } setPrompt = { setPrompt } />
110+ </ motion . div >
111+ ) }
104112 </ motion . div >
105113 ) ;
106114}
0 commit comments