Skip to content

Commit 845b4b8

Browse files
committed
feat: 优化附件管理器
1 parent 6871688 commit 845b4b8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/src/sub/AttachmentsWindow.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Button } from "@/components/ui/button";
2+
import { Card } from "@/components/ui/card";
23
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "@/components/ui/context-menu";
34
import { Dialog } from "@/components/ui/dialog";
45
import { Popover } from "@/components/ui/popover";
@@ -43,7 +44,7 @@ export default function AttachmentsWindow() {
4344
}, [attachments]);
4445

4546
return (
46-
<div className="bg-background flex flex-col gap-2 p-2">
47+
<div className="flex flex-col gap-2 p-2">
4748
<div className="flex gap-3">
4849
<Button
4950
onClick={async () => {
@@ -99,24 +100,24 @@ export default function AttachmentsWindow() {
99100
</div>
100101

101102
{/* 一个又一个的附件展示 */}
102-
<div className="flex flex-wrap gap-1">
103+
<div className="flex flex-wrap gap-2">
103104
{attachments.entries().map(([id, blob]) => (
104105
<ContextMenu key={id}>
105106
{/* 非右键的直接展示部分 */}
106107
<ContextMenuTrigger>
107-
<div className="bg-card hover:bg-primary text-primary hover:text-primary-foreground flex flex-col gap-2 rounded-sm p-1 transition-colors hover:ring">
108+
<Card className="gap-2 p-2">
108109
{/* <Separator /> */}
109110
{blob.type.startsWith("image") && (
110-
<img src={urls.get(id)} alt={id} className="max-h-12 max-w-full object-contain" />
111+
<img src={urls.get(id)} alt={id} className="max-w-full rounded-lg object-contain" />
111112
)}
112113
<div className="flex flex-col gap-0.5">
113-
<span className="text-[6px] opacity-50">{id}</span>
114-
<div className="flex flex-wrap gap-x-2 text-xs">
114+
<span className="text-[8px] opacity-50">{id}</span>
115+
<div className="flex flex-wrap gap-x-2 text-sm">
115116
<span>{blob.type}</span>
116117
<span>{formatBytes(blob.size)}</span>
117118
</div>
118119
</div>
119-
</div>
120+
</Card>
120121
</ContextMenuTrigger>
121122

122123
{/* 右键内容 */}

0 commit comments

Comments
 (0)