display followups in UI

This commit is contained in:
Fraser
2023-06-02 00:29:03 -04:00
parent eee29179db
commit b6b6864ea2
3 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ from typing import List
from urllib.parse import quote
import requests
SIMILARITY_THRESHOLD = 0.5 # total shot in the dark - play with this later
SIMILARITY_THRESHOLD = 0.4 # bit of a shot in the dark - play with this later
MAX_FOLLOWUPS = 3
@dataclass
+15
View File
@@ -426,6 +426,21 @@ const Home: NextPage = () => {
return <></>
})}
{(() => {
if (loadState.state === "idle") {
return <div className="flex flex-col items-end"> {
loadState.followups.map((followup, i) => {
return <li key={i}>
<button className="border border-gray-300 px-1 my-1">
<span> {followup.text} </span>
</button>
</li>
})
}</div>
}
return <></>;
})()}
<SearchBox search={search} />
{(() => {
+1 -1
View File
@@ -22,7 +22,7 @@ const SearchBox: React.FC<{search: (
if (loading) return <></>;
return (<>
<form className="flex mb-2" onSubmit={async (e) => {
<form className="flex mb-2 mt-1" onSubmit={async (e) => {
e.preventDefault();
search(query, setQuery, setLoading);
}}>