From 590bd8647e00f0846f2efd3bde48bd5b4e5f28f7 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 22 Jan 2026 18:43:10 -0800 Subject: [PATCH] Video in post preview --- src/components/Compose.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/Compose.tsx b/src/components/Compose.tsx index 9295245..797986f 100644 --- a/src/components/Compose.tsx +++ b/src/components/Compose.tsx @@ -3,6 +3,7 @@ import { useState, useEffect } from 'react'; import AutoTextarea from '@/components/AutoTextarea'; import { Post, Attachment } from '@/lib/types'; +import { VideoEmbed } from '@/components/VideoEmbed'; interface ComposeProps { onPost: (content: string, mediaIds: string[], linkPreview?: any, replyToId?: string) => void; @@ -159,17 +160,20 @@ export function Compose({ onPost, replyingTo, onCancelReply, placeholder = "What > x -
- {linkPreview.image && ( -
- + + {!linkPreview.url.match(/(youtube\.com|youtu\.be|vimeo\.com)/) && ( +
+ {linkPreview.image && ( +
+ +
+ )} +
+
{linkPreview.title}
+
{new URL(linkPreview.url.startsWith('http') ? linkPreview.url : `https://${linkPreview.url}`).hostname}
- )} -
-
{linkPreview.title}
-
{new URL(linkPreview.url.startsWith('http') ? linkPreview.url : `https://${linkPreview.url}`).hostname}
-
+ )}
)}