client error handling, regen response without saving messages

This commit is contained in:
Danny Avila 2023-02-08 15:26:42 -05:00
parent 87685c3791
commit 217bdb4865
11 changed files with 261 additions and 62 deletions

View file

@ -1,17 +1,20 @@
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">
<>
<span className="mb-auto block flex justify-center 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">
<button
onClick={clickHandler}
className="btn btn-primary m-auto flex justify-center gap-2"
>
<svg
stroke="currentColor"
fill="none"
@ -24,11 +27,12 @@ export default function Regenerate({ submitMessage }) {
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"/>
<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>
</>
);
}