diff --git a/web/app/_components/InputToolbar/index.tsx b/web/app/_components/InputToolbar/index.tsx index 16eccf920c..a150826a11 100644 --- a/web/app/_components/InputToolbar/index.tsx +++ b/web/app/_components/InputToolbar/index.tsx @@ -15,6 +15,7 @@ import { import useGetInputState from '@hooks/useGetInputState' import { Button } from '../../../uikit/button' import useStartStopModel from '@hooks/useStartStopModel' +import { userConversationsAtom } from '@helpers/atoms/Conversation.atom' const InputToolbar: React.FC = () => { const activeModel = useAtomValue(activeAssistantModelAtom) @@ -23,6 +24,8 @@ const InputToolbar: React.FC = () => { const { requestCreateConvo } = useCreateConversation() const { startModel } = useStartStopModel() + const conversations = useAtomValue(userConversationsAtom) + const activeConvoId = useAtomValue(getActiveConvoIdAtom) const onNewConversationClick = () => { @@ -68,31 +71,32 @@ const InputToolbar: React.FC = () => { ) } - return ( -
- {currentConvoState?.error && ( -
- - {currentConvoState?.error?.toString()} - + if (conversations.length > 0) + return ( +
+ {currentConvoState?.error && ( +
+ + {currentConvoState?.error?.toString()} + +
+ )} +
+ } + />
- )} -
- } - /> -
- {/* My text input */} -
-
- - + {/* My text input */} +
+
+ + +
-
- ) + ) } export default InputToolbar diff --git a/web/app/_components/LeftHeaderAction/index.tsx b/web/app/_components/LeftHeaderAction/index.tsx index c506cb1397..9c99e3260c 100644 --- a/web/app/_components/LeftHeaderAction/index.tsx +++ b/web/app/_components/LeftHeaderAction/index.tsx @@ -34,12 +34,12 @@ const LeftHeaderAction: React.FC = () => { className="flex-1" icon={} /> - } - /> + /> */}
) } diff --git a/web/app/_components/ModalNoActiveModel/index.tsx b/web/app/_components/ModalNoActiveModel/index.tsx new file mode 100644 index 0000000000..c2b8439535 --- /dev/null +++ b/web/app/_components/ModalNoActiveModel/index.tsx @@ -0,0 +1,72 @@ +import React, { Fragment } from 'react' +import { Dialog, Transition } from '@headlessui/react' +import { useAtom, useSetAtom } from 'jotai' +import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom' +import { + MainViewState, + setMainViewStateAtom, +} from '@helpers/atoms/MainView.atom' + +const ModalNoActiveModel: React.FC = () => { + const [show, setShow] = useAtom(showingModalNoActiveModel) + const setMainView = useSetAtom(setMainViewStateAtom) + + return ( + + + +
+ + +
+
+ + +

+ There is no active model at the moment ... +

+
+ + +
+
+
+
+
+
+
+ ) +} + +export default React.memo(ModalNoActiveModel) diff --git a/web/app/_components/SidebarEmptyHistory/index.tsx b/web/app/_components/SidebarEmptyHistory/index.tsx index 57aa5436c5..1cb4e3a6c2 100644 --- a/web/app/_components/SidebarEmptyHistory/index.tsx +++ b/web/app/_components/SidebarEmptyHistory/index.tsx @@ -9,6 +9,7 @@ import { activeAssistantModelAtom } from '@helpers/atoms/Model.atom' import { useGetDownloadedModels } from '@hooks/useGetDownloadedModels' import { Button } from '@uikit' import { MessageCircle } from 'lucide-react' +import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom' enum ActionButton { DownloadModel = 'Download a Model', @@ -21,6 +22,7 @@ const SidebarEmptyHistory: React.FC = () => { const setMainView = useSetAtom(setMainViewStateAtom) const { requestCreateConvo } = useCreateConversation() const [action, setAction] = useState(ActionButton.DownloadModel) + const modalNoActiveModel = useSetAtom(showingModalNoActiveModel) useEffect(() => { if (downloadedModels.length > 0) { @@ -35,7 +37,7 @@ const SidebarEmptyHistory: React.FC = () => { setMainView(MainViewState.ExploreModel) } else { if (!activeModel) { - setMainView(MainViewState.ConversationEmptyModel) + modalNoActiveModel(true) } else { await requestCreateConvo(activeModel) } @@ -44,10 +46,10 @@ const SidebarEmptyHistory: React.FC = () => { return (
- -
+ +
No Chat History
-

+

Get started by creating a new chat.