/* eslint-disable react-hooks/rules-of-hooks */ 'use client' import BasicPromptInput from '../BasicPromptInput' import BasicPromptAccessories from '../BasicPromptAccessories' import { useAtomValue, useSetAtom } from 'jotai' import SecondaryButton from '../SecondaryButton' import { PlusIcon } from '@heroicons/react/24/outline' import useCreateConversation from '@hooks/useCreateConversation' import { activeModelAtom, stateModel } from '@helpers/atoms/Model.atom' import { currentConvoStateAtom, getActiveConvoIdAtom, } from '@helpers/atoms/Conversation.atom' import useGetInputState from '@hooks/useGetInputState' import useStartStopModel from '@hooks/useStartStopModel' import { userConversationsAtom } from '@helpers/atoms/Conversation.atom' import { showingModalNoActiveModel } from '@helpers/atoms/Modal.atom' const InputToolbar: React.FC = () => { const activeModel = useAtomValue(activeModelAtom) const currentConvoState = useAtomValue(currentConvoStateAtom) const { inputState, currentConvo } = useGetInputState() const { requestCreateConvo } = useCreateConversation() const { startModel } = useStartStopModel() const { loading } = useAtomValue(stateModel) const conversations = useAtomValue(userConversationsAtom) const activeConvoId = useAtomValue(getActiveConvoIdAtom) const setShowModalNoActiveModel = useSetAtom(showingModalNoActiveModel) const onNewConversationClick = () => { if (activeModel) { requestCreateConvo(activeModel) } else { setShowModalNoActiveModel(true) } } const onStartModelClick = () => { const modelId = currentConvo?.modelId if (!modelId) return startModel(modelId) } if (!activeConvoId) { return null } if ( (activeConvoId && inputState === 'model-mismatch') || inputState === 'loading' ) { // const message = inputState === 'loading' ? 'Loading..' : 'Model mismatch!' return (
{message}
*/}Model {currentConvo?.modelId} not found! Please re-download the model first.