@@ -16,12 +16,14 @@ import {
1616import useGetBots from '@hooks/useGetBots'
1717import { activeBotAtom } from '@helpers/atoms/Bot.atom'
1818import { useGetDownloadedModels } from '@hooks/useGetDownloadedModels'
19+ import { userConversationsAtom } from '@helpers/atoms/Conversation.atom'
1920
2021const InputToolbar : React . FC = ( ) => {
2122 const activeModel = useAtomValue ( activeAssistantModelAtom )
2223 const { requestCreateConvo } = useCreateConversation ( )
2324 const currentConvoState = useAtomValue ( currentConvoStateAtom )
2425 const currentConvo = useAtomValue ( currentConversationAtom )
26+ const conversations = useAtomValue ( userConversationsAtom )
2527
2628 const setActiveBot = useSetAtom ( activeBotAtom )
2729 const { getBotById } = useGetBots ( )
@@ -81,31 +83,32 @@ const InputToolbar: React.FC = () => {
8183 </ div >
8284 )
8385
84- return (
85- < div className = "sticky bottom-0 w-full bg-background/90 px-5 py-0" >
86- { currentConvoState ?. error && (
87- < div className = "flex flex-row justify-center" >
88- < span className = "mx-5 my-2 text-sm text-red-500" >
89- { currentConvoState ?. error ?. toString ( ) }
90- </ span >
86+ if ( conversations . length > 0 )
87+ return (
88+ < div className = "sticky bottom-0 w-full bg-background/90 px-5 py-0" >
89+ { currentConvoState ?. error && (
90+ < div className = "flex flex-row justify-center" >
91+ < span className = "mx-5 my-2 text-sm text-red-500" >
92+ { currentConvoState ?. error ?. toString ( ) }
93+ </ span >
94+ </ div >
95+ ) }
96+ < div className = "my-3 flex justify-center gap-2" >
97+ < SecondaryButton
98+ onClick = { onNewConversationClick }
99+ title = "New Conversation"
100+ icon = { < PlusIcon width = { 16 } height = { 16 } /> }
101+ />
91102 </ div >
92- ) }
93- < div className = "my-3 flex justify-center gap-2" >
94- < SecondaryButton
95- onClick = { onNewConversationClick }
96- title = "New Conversation"
97- icon = { < PlusIcon width = { 16 } height = { 16 } /> }
98- />
99- </ div >
100- { /* My text input */ }
101- < div className = "mb-5 flex items-start space-x-4" >
102- < div className = "relative min-w-0 flex-1" >
103- < BasicPromptInput />
104- < BasicPromptAccessories />
103+ { /* My text input */ }
104+ < div className = "mb-5 flex items-start space-x-4" >
105+ < div className = "relative min-w-0 flex-1" >
106+ < BasicPromptInput />
107+ < BasicPromptAccessories />
108+ </ div >
105109 </ div >
106110 </ div >
107- </ div >
108- )
111+ )
109112}
110113
111114export default InputToolbar
0 commit comments