feat: competitive intelligence & historical pattern matching layer

This commit is contained in:
Celes Renata
2026-04-14 19:42:48 +00:00
parent b478022ba3
commit f7a11d14ea
203 changed files with 20155 additions and 97 deletions
+29 -16
View File
@@ -1,4 +1,4 @@
import { useParams } from '@tanstack/react-router';
import { useParams, Link } from '@tanstack/react-router';
import { useRecommendation } from '../api/hooks';
import { StatusBadge, ConfidenceBar, LoadingSpinner, Card } from '../components/ui';
@@ -67,23 +67,36 @@ export function RecommendationDetailPage() {
<p className="text-sm text-gray-500">No evidence linked</p>
) : (
<div className="space-y-2">
{rec.evidence.map((ev) => (
<div key={ev.id} className="rounded-lg border border-surface-700 bg-surface-950 p-3">
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
<StatusBadge status={ev.evidence_type} />
<span className="text-sm text-gray-200">{ev.title ?? 'Untitled'}</span>
{rec.evidence.map((ev) => {
const isMacro = ev.document_type === 'macro_event' || ev.evidence_type === 'macro_event';
return (
<div key={ev.id} className={`rounded-lg border p-3 ${isMacro ? 'border-purple-700/50 bg-purple-900/10' : 'border-surface-700 bg-surface-950'}`}>
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
{isMacro && (
<Link
to="/macro/events/$id"
params={{ id: ev.document_id }}
className="rounded bg-purple-900/40 border border-purple-700/50 px-1.5 py-0.5 text-[10px] font-medium text-purple-400 hover:text-purple-300"
onClick={(e) => e.stopPropagation()}
>
MACRO
</Link>
)}
<StatusBadge status={ev.evidence_type} />
<span className="text-sm text-gray-200">{ev.title ?? 'Untitled'}</span>
</div>
<span className="font-mono text-xs text-gray-500">weight: {ev.weight.toFixed(3)}</span>
</div>
<div className="mt-1 flex gap-4 text-xs text-gray-500">
<span>{ev.document_type}</span>
<span>{ev.source_type}</span>
{ev.publisher && <span>{ev.publisher}</span>}
{ev.published_at && <span>{new Date(ev.published_at).toLocaleDateString()}</span>}
</div>
<span className="font-mono text-xs text-gray-500">weight: {ev.weight.toFixed(3)}</span>
</div>
<div className="mt-1 flex gap-4 text-xs text-gray-500">
<span>{ev.document_type}</span>
<span>{ev.source_type}</span>
{ev.publisher && <span>{ev.publisher}</span>}
{ev.published_at && <span>{new Date(ev.published_at).toLocaleDateString()}</span>}
</div>
</div>
))}
);
})}
</div>
)}
</Card>