Skip to content

Commit 9900177

Browse files
committed
show video in context pill
1 parent 5394955 commit 9900177

File tree

1 file changed

+17
-6
lines changed
  • apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/context-pills

1 file changed

+17
-6
lines changed

apps/web/client/src/app/project/[id]/_components/right-panel/chat-tab/context-pills/image-pill.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export const ImagePill = React.forwardRef<
1616
return null;
1717
}
1818

19+
const isVideo = context.mimeType?.startsWith('video/');
20+
1921
return (
2022
<motion.span
2123
layout="position"
@@ -33,13 +35,22 @@ export const ImagePill = React.forwardRef<
3335
key={context.displayName}
3436
ref={ref}
3537
>
36-
{/* Left side: Image thumbnail */}
38+
{/* Left side: Image/Video thumbnail */}
3739
<div className="w-7 h-7 flex items-center justify-center overflow-hidden relative">
38-
<img
39-
src={context.content}
40-
alt={context.displayName}
41-
className="w-full h-full object-cover rounded-l-md"
42-
/>
40+
{isVideo ? (
41+
<video
42+
src={context.content}
43+
className="w-full h-full object-cover rounded-l-md"
44+
muted
45+
playsInline
46+
/>
47+
) : (
48+
<img
49+
src={context.content}
50+
alt={context.displayName}
51+
className="w-full h-full object-cover rounded-l-md"
52+
/>
53+
)}
4354
<div className="absolute inset-0 border-l-[1px] border-y-[1px] rounded-l-md border-white/10 pointer-events-none" />
4455
</div>
4556

0 commit comments

Comments
 (0)