stage 4-1
This commit is contained in:
@@ -23,6 +23,24 @@ export const LinkResults: React.FC<LinkResultsProps> = ({
|
||||
linksAdded,
|
||||
linkerVersion,
|
||||
}) => {
|
||||
if (!links || links.length === 0) {
|
||||
return (
|
||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-white">Linking Results</h3>
|
||||
<div className="flex items-center gap-2">
|
||||
<PlugInIcon className="w-5 h-5 text-blue-500" />
|
||||
<span className="text-sm text-gray-600 dark:text-gray-400">Version {linkerVersion}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
|
||||
<PlugInIcon className="w-12 h-12 mx-auto mb-3 opacity-50" />
|
||||
<p className="text-sm">No links found to add</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
@@ -51,14 +69,14 @@ export const LinkResults: React.FC<LinkResultsProps> = ({
|
||||
<ul className="space-y-2">
|
||||
{links.filter(l => l.cluster_match).map((link, index) => (
|
||||
<li key={`cluster-${index}`} className="flex items-center gap-2 text-sm pl-2 border-l-2 border-blue-500">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text || 'Untitled'}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
Content #{link.target_content_id || 'N/A'}
|
||||
</span>
|
||||
{link.relevance_score && (
|
||||
{link.relevance_score !== undefined && (
|
||||
<span className="text-xs text-gray-500 dark:text-gray-400">
|
||||
(Score: {link.relevance_score})
|
||||
(Score: {link.relevance_score.toFixed(1)})
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
@@ -76,14 +94,14 @@ export const LinkResults: React.FC<LinkResultsProps> = ({
|
||||
<ul className="space-y-2">
|
||||
{links.filter(l => !l.cluster_match || l.cluster_match === false).map((link, index) => (
|
||||
<li key={`other-${index}`} className="flex items-center gap-2 text-sm">
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text}"</span>
|
||||
<span className="text-gray-600 dark:text-gray-400">"{link.anchor_text || 'Untitled'}"</span>
|
||||
<span className="text-gray-400">→</span>
|
||||
<span className="text-blue-600 dark:text-blue-400">
|
||||
Content #{link.target_content_id}
|
||||
Content #{link.target_content_id || 'N/A'}
|
||||
</span>
|
||||
{link.relevance_score && (
|
||||
{link.relevance_score !== undefined && (
|
||||
<span className="text-xs text-gray-500 dark:text-gray-400">
|
||||
(Score: {link.relevance_score})
|
||||
(Score: {link.relevance_score.toFixed(1)})
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user