diff --git a/client/src/components/edit-scheduled-post-dialog.tsx b/client/src/components/edit-scheduled-post-dialog.tsx index f70732d..e482fbf 100644 --- a/client/src/components/edit-scheduled-post-dialog.tsx +++ b/client/src/components/edit-scheduled-post-dialog.tsx @@ -10,6 +10,7 @@ import { apiRequest, queryClient } from "@/lib/queryClient"; import type { SocialPage, Media, Post } from "@shared/schema"; import { format } from "date-fns"; import { Image as ImageIcon, CheckCircle } from "lucide-react"; +import { MediaThumbnail } from "@/components/media-thumbnail"; interface EditScheduledPostDialogProps { open: boolean; @@ -165,9 +166,10 @@ export default function EditScheduledPostDialog({ open, onOpenChange, scheduledP if (!media) return null; return (
- Selected
@@ -198,9 +200,10 @@ export default function EditScheduledPostDialog({ open, onOpenChange, scheduledP className="relative group" data-testid={`button-select-media-${media.id}`} > - {media.fileName} to show first frame + * - Images: standard with lazy loading + * - Broken/unavailable URLs: shows a placeholder icon + */ +export function MediaThumbnail({ src, alt, type, className = "w-full h-full object-cover" }: MediaThumbnailProps) { + const [error, setError] = useState(false); + const isVideo = type === 'video' || isVideoUrl(src); + + if (error || !src) { + return ( +
+ {isVideo + ? + : + } +
+ ); + } + + if (isVideo) { + return ( +