"use client"; import { Avatar } from "../ui/primitives"; import { ageLabel } from "../../lib/fixtures"; import type { StreamItem as FeedItem } from "../../lib/streams-data"; import type { Platform } from "../../lib/platforms"; import { SwipeItem } from "./swipe-item"; export function PostCard({ item, platform, onAmplify, onReply, match = "", selected = false, onSelect }: { item: FeedItem; platform: Platform; onAmplify: () => void; onReply: () => void; match?: string; selected?: boolean; onSelect?: () => void }): React.ReactElement { const index = match.trim() === "" ? -1 : item.text.toLowerCase().indexOf(match.trim().toLowerCase()); const text = index < 0 ? item.text : <>{item.text.slice(0, index)}{item.text.slice(index, index + match.trim().length)}{item.text.slice(index + match.trim().length)}; return
{item.author}{item.handle}{ageLabel(item.ageMinutes)}
{item.sourceLabel ?? platform.displayName}

{text}

{item.mediaUrls?.map((url) => View media ↗)} {item.hasMedia && !item.mediaUrls &&
Media preview · sample feed
}
♡ {item.likes}
; }