diff --git a/src/components/Chat/ChatContent/ChatContent.tsx b/src/components/Chat/ChatContent/ChatContent.tsx index ece04b4..aea9de5 100644 --- a/src/components/Chat/ChatContent/ChatContent.tsx +++ b/src/components/Chat/ChatContent/ChatContent.tsx @@ -6,13 +6,15 @@ import ScrollToBottomButton from './ScrollToBottomButton'; import ChatTitle from './ChatTitle'; import Message from './Message'; import NewMessageButton from './Message/NewMessageButton'; +import CrossIcon from '@icon/CrossIcon'; import useSubmit from '@hooks/useSubmit'; const ChatContent = () => { - const [messages, inputRole] = useStore((state) => [ + const [messages, inputRole, setError] = useStore((state) => [ state.messages, state.inputRole, + state.setError, ]); const { handleSubmit, error } = useSubmit(); @@ -39,8 +41,18 @@ const ChatContent = () => { {error !== '' && ( -
- {error} +
+
+ {error} +
+
{ + setError(''); + }} + > + +
)} @@ -53,12 +65,6 @@ const ChatContent = () => { > Submit - {/* */}
diff --git a/src/hooks/useSubmit.ts b/src/hooks/useSubmit.ts index 4b9a822..7980ef5 100644 --- a/src/hooks/useSubmit.ts +++ b/src/hooks/useSubmit.ts @@ -77,9 +77,6 @@ const useSubmit = () => { const err = (e as Error).message; console.log(err); setError(err); - setTimeout(() => { - setError(''); - }, 10000); } setGenerating(false); };