'use client' import { useState } from 'react' import { IconChevronDown as ChevronDown, IconChevronUp as ChevronUp, IconFileText as FileText } from '@tabler/icons-react' import { faviconUrl } from '@/lib/utils/favicon' // Collapsed card for a pasted text blob (a `data-pastedContent` part, or a // legacy `` block in old messages). export function PastedContentCard({ text, label = 'Pasted content' }: { text: string label?: string }) { const [open, setOpen] = useState(false) return (
{open && (

{text}

)}
) } // Favicon chip for a pasted URL (a `data-sourceUrl` part). Clickable. export function UrlChip({ url }: { url: string }) { let host = url try { host = new URL(url).host.replace(/^www\./, '') } catch {} const favicon = faviconUrl(host, 32) return ( {favicon && ( /* eslint-disable-next-line @next/next/no-img-element */ )} {host} ) }