dark mode alternates to light mode on dark theme, error state in progress

This commit is contained in:
Danny Avila 2023-02-08 10:49:38 -05:00
parent 5cd50e7826
commit 0c6dc8665b
6 changed files with 118 additions and 6 deletions

View file

@ -0,0 +1,34 @@
import React from 'react';
export default function Regenerate({ submitMessage }) {
const clickHandler = (e) => {
e.preventDefault();
submitMessage();
};
return (
<span className="mb-3 block text-xs md:mb-auto">
There was an error generating a response
</span>
<button onClick={clickHandler} className="btn btn-primary m-auto flex justify-center gap-2">
<svg
stroke="currentColor"
fill="none"
strokeWidth="1.5"
viewBox="0 0 24 24"
strokeLinecap="round"
strokeLinejoin="round"
className="h-3 w-3"
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<polyline points="1 4 1 10 7 10"/>
<polyline points="23 20 23 14 17 14"/>
<path d="M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15"/>
</svg>
Regenerate response
</button>
);
}

View file

@ -9,7 +9,6 @@ import { setSubmitState } from '~/store/submitSlice';
import { setText } from '~/store/textSlice';
export default function TextChat({ messages, reloadConvos }) {
// const [text, setText] = useState('');
const dispatch = useDispatch();
const convo = useSelector((state) => state.convo);
const { isSubmitting } = useSelector((state) => state.submit);
@ -47,6 +46,7 @@ export default function TextChat({ messages, reloadConvos }) {
};
dispatch(setSubmitState(false));
dispatch(setMessages([...messages, currentMsg, errorResponse]));
dispatch(setText(payload));
return;
};
console.log('User Input:', payload);