'use client';
import { ExternalLink } from 'lucide-react';
import * as Tooltip from '@radix-ui/react-tooltip';
import type { Citation as CitationType } from '@/lib/types';
interface CitationProps {
citation: CitationType;
compact?: boolean;
}
export function Citation({ citation, compact }: CitationProps) {
if (compact) {
return (
{citation.index}
);
}
return (
{citation.title}
{citation.snippet}
{
(e.target as HTMLImageElement).style.display = 'none';
}}
/>
)}
{citation.domain}
{
(e.target as HTMLImageElement).style.display = 'none';
}}
/>
)}
{citation.domain}