SarahXia0405 commited on
Commit
7e1caca
·
verified ·
1 Parent(s): db8e109

Update web/src/components/Message.tsx

Browse files
Files changed (1) hide show
  1. web/src/components/Message.tsx +21 -9
web/src/components/Message.tsx CHANGED
@@ -312,11 +312,13 @@ export function Message({
312
  ${isUser && !showSenderInfo ? "bg-primary text-primary-foreground" : "bg-muted"}
313
  `}
314
  >
315
- {/* ✅ Attachments shown “with” the message */}
316
  {hasAttachments && (
317
  <div className="mb-3 flex flex-wrap gap-2">
318
  {attachments!.map((a, idx) => {
319
- const icon = a.kind === "pdf" ? pdfIcon : a.kind === "ppt" ? pptIcon : otherIcon;
 
 
320
  const label =
321
  a.kind === "pdf"
322
  ? "PDF"
@@ -332,19 +334,29 @@ export function Message({
332
  <div
333
  key={`${a.name}-${idx}`}
334
  className="
335
- inline-flex items-center gap-2
336
  rounded-xl border border-border
337
- bg-background/70 dark:bg-background/30
338
- px-2 py-1
 
339
  shadow-sm
340
  max-w-full
341
  "
342
  title={a.name}
343
  >
344
- <img src={icon} alt={a.name} className="h-6 w-6 object-contain" draggable={false} />
345
- <div className="min-w-0">
346
- <div className="text-xs font-medium truncate max-w-[320px]">{a.name}</div>
347
- <div className="text-[11px] text-muted-foreground">{label}</div>
 
 
 
 
 
 
 
 
 
348
  </div>
349
  </div>
350
  );
 
312
  ${isUser && !showSenderInfo ? "bg-primary text-primary-foreground" : "bg-muted"}
313
  `}
314
  >
315
+ {/* ✅ Attachments shown “with” the message (neutral card style) */}
316
  {hasAttachments && (
317
  <div className="mb-3 flex flex-wrap gap-2">
318
  {attachments!.map((a, idx) => {
319
+ const icon =
320
+ a.kind === "pdf" ? pdfIcon : a.kind === "ppt" ? pptIcon : otherIcon;
321
+
322
  const label =
323
  a.kind === "pdf"
324
  ? "PDF"
 
334
  <div
335
  key={`${a.name}-${idx}`}
336
  className="
337
+ inline-flex items-center gap-3
338
  rounded-xl border border-border
339
+ bg-white text-foreground
340
+ dark:bg-zinc-900 dark:text-zinc-100
341
+ px-3 py-2
342
  shadow-sm
343
  max-w-full
344
  "
345
  title={a.name}
346
  >
347
+ <img
348
+ src={icon}
349
+ alt={a.name}
350
+ className="h-6 w-6 object-contain opacity-90"
351
+ draggable={false}
352
+ />
353
+ <div className="min-w-0 leading-tight">
354
+ <div className="text-sm font-medium truncate max-w-[320px]">
355
+ {a.name}
356
+ </div>
357
+ <div className="text-[11px] text-muted-foreground mt-0.5">
358
+ {label}
359
+ </div>
360
  </div>
361
  </div>
362
  );