first commit
This commit is contained in:
@@ -23,7 +23,6 @@ import html2canvas from "html2canvas";
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
BarChart3,
|
|
||||||
Download,
|
Download,
|
||||||
FileSpreadsheet,
|
FileSpreadsheet,
|
||||||
FileText,
|
FileText,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function createMessage(role: ChatMessage["role"], content: unknown): ChatMessage
|
|||||||
export default function ChatCanvas() {
|
export default function ChatCanvas() {
|
||||||
const [input, setInput] = useState("");
|
const [input, setInput] = useState("");
|
||||||
const [messages, setMessages] = useState<ChatMessage[]>([]);
|
const [messages, setMessages] = useState<ChatMessage[]>([]);
|
||||||
const [selectedHistoryId, setSelectedHistoryId] = useState<string | null>(null);
|
// const [selectedHistoryId, setSelectedHistoryId] = useState<string | null>(null);
|
||||||
const [error, setError] = useState("");
|
const [error, setError] = useState("");
|
||||||
const [isSending, setIsSending] = useState(false);
|
const [isSending, setIsSending] = useState(false);
|
||||||
const [showHistory, setShowHistory] = useState(true);
|
const [showHistory, setShowHistory] = useState(true);
|
||||||
@@ -64,15 +64,15 @@ export default function ChatCanvas() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const history = messages.filter((message) => message.role === "user");
|
// const history = messages.filter((message) => message.role === "user");
|
||||||
|
|
||||||
const handleSelectHistory = (message: ChatMessage) => {
|
// const handleSelectHistory = (message: ChatMessage) => {
|
||||||
if (typeof message.content === "string") {
|
// if (typeof message.content === "string") {
|
||||||
setInput(message.content);
|
// setInput(message.content);
|
||||||
setSelectedHistoryId(message.id);
|
// setSelectedHistoryId(message.id);
|
||||||
setError("");
|
// setError("");
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
|
|
||||||
const onSubmit = async (event: React.FormEvent) => {
|
const onSubmit = async (event: React.FormEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user