Fixes#1368
Previously, was duplicated in 4 places with 3 subtly different fallback behaviors:
1. inline-citation.tsx: returned on error
2. markdown-text.tsx: returned on error
3. assistant-message.tsx: returned on error
4. citation.tsx: returned on error
Created canonical in that:
- Returns
- Strips prefix from hostname
- Returns on invalid URL (safest contract)
Updated all 4 call sites:
- inline-citation.tsx: (preserves original fallback)
- markdown-text.tsx: (preserves original fallback)
- assistant-message.tsx: (drop-in, both return )
- citation.tsx: (drop-in, both return )
Co-authored-by: guangyang1206 <guangyang1206@users.noreply.github.com>
Move the duplicated TYPE_ICONS record from citation.tsx and
citation-list.tsx into a new type-icons.ts module so the mapping lives
in one place and both components import from the same source.
Resolves#1190
- Replace raw <img> with Next.js Image in markdown-viewer.tsx
- Use next/image with fill + sizes in assistant-ui image.tsx
- Optimize favicons with explicit dimensions in citation components
- Set unoptimized=true for data/blob URLs and external favicons