feat: Alinhar mensagens e permitir anexos

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 19:04:15 +00:00
parent b64672fb06
commit 51f8828f70
3 changed files with 144 additions and 42 deletions
+12 -1
View File
@@ -10,6 +10,11 @@ interface Message {
role: "user" | "assistant";
content: string;
model?: string;
attachments?: Array<{
name: string;
type: string;
size: number;
}>;
}
export const ChatView = () => {
@@ -26,11 +31,16 @@ export const ChatView = () => {
const [isLoading, setIsLoading] = useState(false);
const handleSendMessage = (content: string) => {
const handleSendMessage = (content: string, files?: File[]) => {
const newMessage: Message = {
id: Date.now().toString(),
role: "user",
content,
attachments: files?.map((file) => ({
name: file.name,
type: file.type,
size: file.size,
})),
};
setMessages((prev) => [...prev, newMessage]);
@@ -74,6 +84,7 @@ export const ChatView = () => {
role={message.role}
content={message.content}
model={message.model}
attachments={message.attachments}
/>
))}