-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
44 lines (35 loc) · 968 Bytes
/
Copy pathApp.js
File metadata and controls
44 lines (35 loc) · 968 Bytes
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
import { useState } from "react";
function App() {
const [message, setMessage] = useState("");
const [response, setResponse] = useState("");
const sendMessage = async () => {
const res = await fetch("http://127.0.0.1:8000/chat", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ message }),
});
const data = await res.json();
setResponse(data.response);
};
return (
<div style={{ padding: "40px", fontFamily: "Arial" }}>
<h2>AI‑First CRM – HCP Interaction Logger</h2>
<textarea
rows="5"
cols="60"
placeholder="Enter HCP interaction details..."
value={message}
onChange={(e) => setMessage(e.target.value)}
/>
<br /><br />
<button onClick={sendMessage}>
Log Interaction
</button>
<h3>AI Response:</h3>
<p>{response}</p>
</div>
);
}
export default App;