Spaces:
Sleeping
Sleeping
Update web/src/components/ChatArea.tsx
Browse files
web/src/components/ChatArea.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
| 10 |
Share2,
|
| 11 |
Upload,
|
| 12 |
X,
|
|
|
|
| 13 |
File,
|
| 14 |
FileText,
|
| 15 |
Presentation,
|
|
@@ -19,6 +20,7 @@ import {
|
|
| 19 |
Download,
|
| 20 |
Copy,
|
| 21 |
} from "lucide-react";
|
|
|
|
| 22 |
import { Message } from "./Message";
|
| 23 |
import { Tabs, TabsList, TabsTrigger } from "./ui/tabs";
|
| 24 |
import type {
|
|
@@ -616,16 +618,17 @@ export function ChatArea({
|
|
| 616 |
{/* 叉叉:只 stopPropagation,不要一堆 stopImmediatePropagation,避免某些浏览器/事件链出问题 */}
|
| 617 |
<button
|
| 618 |
type="button"
|
| 619 |
-
aria-label="Remove file"
|
| 620 |
-
title="Remove"
|
| 621 |
onClick={(e) => {
|
|
|
|
| 622 |
e.stopPropagation();
|
| 623 |
-
|
| 624 |
}}
|
| 625 |
-
className="h-7 w-7 rounded-
|
|
|
|
| 626 |
>
|
| 627 |
-
<
|
| 628 |
</button>
|
|
|
|
| 629 |
|
| 630 |
{/* 文本区 */}
|
| 631 |
<div className="min-w-0 flex-1">
|
|
|
|
| 10 |
Share2,
|
| 11 |
Upload,
|
| 12 |
X,
|
| 13 |
+
Trash2,
|
| 14 |
File,
|
| 15 |
FileText,
|
| 16 |
Presentation,
|
|
|
|
| 20 |
Download,
|
| 21 |
Copy,
|
| 22 |
} from "lucide-react";
|
| 23 |
+
|
| 24 |
import { Message } from "./Message";
|
| 25 |
import { Tabs, TabsList, TabsTrigger } from "./ui/tabs";
|
| 26 |
import type {
|
|
|
|
| 618 |
{/* 叉叉:只 stopPropagation,不要一堆 stopImmediatePropagation,避免某些浏览器/事件链出问题 */}
|
| 619 |
<button
|
| 620 |
type="button"
|
|
|
|
|
|
|
| 621 |
onClick={(e) => {
|
| 622 |
+
e.preventDefault();
|
| 623 |
e.stopPropagation();
|
| 624 |
+
onRemoveFile?.(index); // ✅ 用 index 删(前后端状态都会删掉)
|
| 625 |
}}
|
| 626 |
+
className="ml-2 inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-card hover:bg-muted"
|
| 627 |
+
title="Remove"
|
| 628 |
>
|
| 629 |
+
<Trash2 className="h-4 w-4" />
|
| 630 |
</button>
|
| 631 |
+
|
| 632 |
|
| 633 |
{/* 文本区 */}
|
| 634 |
<div className="min-w-0 flex-1">
|