complete renaming functions, abstracts more svg, sets title to current convo title, adds a try again feature to errors

This commit is contained in:
Daniel Avila 2023-02-11 10:22:15 -05:00
parent 592b7629aa
commit 5af5a97d8f
24 changed files with 512 additions and 82 deletions

View file

@ -1,6 +1,7 @@
import React from 'react';
import RegenerateIcon from '../svg/RegenerateIcon';
export default function Regenerate({ submitMessage }) {
export default function Regenerate({ submitMessage, tryAgain }) {
const clickHandler = (e) => {
e.preventDefault();
submitMessage();
@ -8,31 +9,22 @@ export default function Regenerate({ submitMessage }) {
return (
<>
<span className="mb-auto block flex justify-center text-xs md:mb-auto">
<span className="mb-2 block flex justify-center text-xs md:mb-2">
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"
<span className="m-auto flex justify-center">
<button
onClick={clickHandler}
className="btn btn-primary m-auto flex justify-center gap-2"
>
<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>
<RegenerateIcon />
Regenerate response
</button>
<button onClick={tryAgain} className="btn btn-neutral flex justify-center gap-2 border-0 md:border">
<RegenerateIcon />
Try another message
</button>
</span>
</>
);
}