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"}
); }