"use client"; /** * The link card shown under a message, and in the composer before sending. * * Everything rendered here was fetched by the BFF. A client can choose whether * a card appears, never what it says — otherwise any link could be dressed up * as any site. */ import { X } from "lucide-react"; import { cn } from "@/lib/utils"; import type { LinkPreview } from "@/lib/chat"; export function LinkPreviewCard({ preview, onDismiss, compact = false, className, }: { preview: LinkPreview; /** When set, a dismiss control is shown (composer only). */ onDismiss?: () => void; compact?: boolean; className?: string; }) { const body = (
{preview.site_name}
)}{preview.title || preview.url}
{!compact && preview.description && ({preview.description}
)}