import { MessageCircle } from "lucide-react"; import type { EmbeddedTweet } from "#/lib/types"; import { cx, feedActionIconClass, feedRowHandleClass, feedRowNameClass, feedRowTimestampClass, } from "#/lib/ui"; import { AvatarChip } from "./AvatarChip"; import { BirdclawEmpty, BirdclawLoading } from "./BrandMark"; import { ProfilePreview } from "./ProfilePreview"; import { SmartTimestamp } from "./SmartTimestamp"; import { TweetArticleCard } from "./TweetArticleCard"; import { TweetMediaGrid } from "./TweetMediaGrid"; import { TweetRichText } from "./TweetRichText"; export function ConversationThread({ anchorId, error, items, loading, }: { anchorId: string; error?: string | null; items: EmbeddedTweet[]; loading: boolean; }) { if (loading) { return (
); } if (error) { return (
{error}
); } if (items.length <= 1) { return (
); } return (
{items.length} tweets in conversation
{items.map((tweet, index) => { const isAnchor = tweet.id === anchorId; return (
0 && "border-t border-[var(--line)]", isAnchor && "bg-[var(--accent-soft)]", )} key={tweet.id} >
{index < items.length - 1 ? ( ) : null}
{tweet.author.displayName} @{tweet.author.handle} ยท {isAnchor ? ( selected ) : null}
{tweet.entities.article ? ( ) : null}
); })}
); }