From 9f1ee3864ba6e980744788e415691ac77950b2b3 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 14 Oct 2025 02:39:43 +0000 Subject: [PATCH] Add FeedItemCard component cgen-2067f4f1f1394b39896a5693f6c52aff --- client/components/social/FeedItemCard.tsx | 158 ++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 client/components/social/FeedItemCard.tsx diff --git a/client/components/social/FeedItemCard.tsx b/client/components/social/FeedItemCard.tsx new file mode 100644 index 00000000..d36676f2 --- /dev/null +++ b/client/components/social/FeedItemCard.tsx @@ -0,0 +1,158 @@ +import { useState } from "react"; +import { + Card, + CardContent, + CardHeader, + CardTitle, + CardDescription, +} from "@/components/ui/card"; +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; +import { Button } from "@/components/ui/button"; +import { Badge } from "@/components/ui/badge"; +import { Separator } from "@/components/ui/separator"; +import { cn } from "@/lib/utils"; +import { + Heart, + MessageCircle, + Share2, + Volume2, + VolumeX, +} from "lucide-react"; +import type { FeedItem } from "@/pages/Feed"; + +interface FeedItemCardProps { + item: FeedItem; + isFollowing: boolean; + onToggleFollow: (authorId: string) => void; + onShare: (postId: string) => void; +} + +export function FeedItemCard({ + item, + isFollowing, + onToggleFollow, + onShare, +}: FeedItemCardProps) { + const [muted, setMuted] = useState(true); + const hasMedia = item.mediaType !== "none" && Boolean(item.mediaUrl); + + return ( + + +
+
+ + + + {item.authorName?.[0]?.toUpperCase() || "U"} + + +
+ + {item.authorName} + + + {item.caption ? item.caption.slice(0, 120) : "Shared an update"} + +
+
+ +
+
+ + {hasMedia && ( +
+ {item.mediaType === "video" ? ( + <> +
+ )} + + {item.caption && ( +

+ {item.caption} +

+ )} + +
+
+
+ + +
+
+ + {item.mediaType === "video" + ? "Video" + : item.mediaType === "image" + ? "Image" + : "Update"} + + + +
+
+
+
+
+ ); +}