diff --git a/web/app/_components/LeftHeaderAction/index.tsx b/web/app/_components/LeftHeaderAction/index.tsx
index c506cb139..e8e978bc5 100644
--- a/web/app/_components/LeftHeaderAction/index.tsx
+++ b/web/app/_components/LeftHeaderAction/index.tsx
@@ -2,22 +2,37 @@
import React from 'react'
import SecondaryButton from '../SecondaryButton'
-import { useSetAtom } from 'jotai'
+import { useSetAtom, useAtomValue } from 'jotai'
import {
MainViewState,
setMainViewStateAtom,
} from '@helpers/atoms/MainView.atom'
import { MagnifyingGlassIcon, PlusIcon } from '@heroicons/react/24/outline'
+import useCreateConversation from '@hooks/useCreateConversation'
import { useGetDownloadedModels } from '@hooks/useGetDownloadedModels'
+import { Button } from '@uikit'
+import { activeAssistantModelAtom } from '@helpers/atoms/Model.atom'
+import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom'
const LeftHeaderAction: React.FC = () => {
const setMainView = useSetAtom(setMainViewStateAtom)
const { downloadedModels } = useGetDownloadedModels()
+ const activeModel = useAtomValue(activeAssistantModelAtom)
+ const { requestCreateConvo } = useCreateConversation()
+ const setShowModalNoActiveModel = useSetAtom(showingModalNoActiveModel)
const onExploreClick = () => {
setMainView(MainViewState.ExploreModel)
}
+ const onNewConversationClick = () => {
+ if (activeModel) {
+ requestCreateConvo(activeModel)
+ } else {
+ setShowModalNoActiveModel(true)
+ }
+ }
+
const onCreateBotClicked = () => {
if (downloadedModels.length === 0) {
alert('You need to download at least one model to create a bot.')
@@ -27,19 +42,28 @@ const LeftHeaderAction: React.FC = () => {
}
return (
-
-
}
- />
-
}
- />
+
+
+ }
+ />
+ }
+ />
+
+
)
}
diff --git a/web/app/_components/SecondaryButton/index.tsx b/web/app/_components/SecondaryButton/index.tsx
index 2491edeba..be1d85146 100644
--- a/web/app/_components/SecondaryButton/index.tsx
+++ b/web/app/_components/SecondaryButton/index.tsx
@@ -16,7 +16,13 @@ const SecondaryButton: React.FC
= ({
className,
icon,
}) => (
-