({ metadata, error }: ResultDisplayProps)
| 12 | } |
| 13 | |
| 14 | export function ResultDisplay({ metadata, error }: ResultDisplayProps) { |
| 15 | if (error) { |
| 16 | return ( |
| 17 | <div className="rounded-lg border border-destructive p-4"> |
| 18 | <p className="text-sm text-destructive">{error}</p> |
| 19 | </div> |
| 20 | ); |
| 21 | } |
| 22 | |
| 23 | if (!metadata) { |
| 24 | return null; |
| 25 | } |
| 26 | |
| 27 | return ( |
| 28 | <div className="space-y-4 rounded-lg border p-4"> |
| 29 | <div className="flex items-center gap-2"> |
| 30 | {metadata.favicon && ( |
| 31 | <img |
| 32 | src={metadata.favicon} |
| 33 | alt="Site favicon" |
| 34 | width={16} |
| 35 | height={16} |
| 36 | className="h-4 w-4" |
| 37 | /> |
| 38 | )} |
| 39 | <h3 className="font-medium">{metadata.title}</h3> |
| 40 | </div> |
| 41 | |
| 42 | {metadata.description && ( |
| 43 | <p className="text-sm text-muted-foreground">{metadata.description}</p> |
| 44 | )} |
| 45 | |
| 46 | {metadata.ogImage && ( |
| 47 | <img |
| 48 | src={metadata.ogImage} |
| 49 | alt="Open Graph preview" |
| 50 | width={300} |
| 51 | height={200} |
| 52 | className="rounded-lg" |
| 53 | /> |
| 54 | )} |
| 55 | |
| 56 | <p className="text-xs text-muted-foreground">{metadata.url}</p> |
| 57 | </div> |
| 58 | ); |
| 59 | } |
nothing calls this directly
no outgoing calls
no test coverage detected