-
Notifications
You must be signed in to change notification settings - Fork 1
/
GptChat.tsx
45 lines (41 loc) · 1.14 KB
/
GptChat.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import type { FC } from "hono/jsx";
export const GptChat: FC<{ myname: string; models_name: string[] }> = (props: {
myname: string;
models_name: string[];
}) => {
return (
<div>
<div id="gpt_container" class="flex-container">
{props.models_name.map((m) => {
return (
<div class="flex-item">
<div>
{m}
<br />
</div>
<div id={m}></div>
</div>
);
})}
</div>
<div class="flex-container">
<div class="flex-item">
<form id="gptForm" hx-post="/gpt" hx-target="#server_status">
<input
id="myname"
name="myname"
title="my name"
type="hidden"
value={props.myname}
/>
<textarea id="msg" name="msg" title="msg" ></textarea>
<button type="submit">Send</button>
</form>
</div>
</div>
<div id="server_status"></div>
<hr/>
<div style="display:flex;flex-direction: row; flex-wrap: wrap;" id="send_div"></div>
</div>
);
};