diff --git a/frontend/src/pages/CompanyDetail.tsx b/frontend/src/pages/CompanyDetail.tsx index d00059d..70ce5c6 100644 --- a/frontend/src/pages/CompanyDetail.tsx +++ b/frontend/src/pages/CompanyDetail.tsx @@ -1,4 +1,4 @@ -import { useParams, useNavigate } from '@tanstack/react-router'; +import { useParams, useNavigate, Link } from '@tanstack/react-router'; import { useState } from 'react'; import { useCompany, @@ -14,6 +14,7 @@ import { useTrends, useTrendHistory, useMarketPrices, + useDocument, } from '../api/hooks'; import { StatusBadge, ConfidenceBar, LoadingSpinner, Card } from '../components/ui'; import { DataTable, type Column } from '../components/DataTable'; @@ -444,62 +445,7 @@ function CompetitiveSignalsPanel({ signals }: { signals: CompetitiveSignal[] }) ) : (
{signals.map((s) => ( -
-
setExpandedId(expandedId === s.id ? null : s.id)} - > -
- COMPETITIVE - {s.source_ticker} - - - -
-
- - {new Date(s.computed_at).toLocaleDateString()} -
-
- {expandedId === s.id && ( - -
-
-
Source Ticker
-
{s.source_ticker}
-
-
-
Target Ticker
-
{s.target_ticker}
-
-
-
Catalyst Type
-
{s.catalyst_type}
-
-
-
Pattern Confidence
-
-
-
-
Signal Strength
-
-
-
-
Relationship Strength
-
-
-
-
Source Document
-
{s.source_document_id}
-
-
-
Computed At
-
{new Date(s.computed_at).toLocaleString()}
-
-
-
- )} -
+ setExpandedId(expandedId === s.id ? null : s.id)} /> ))}
)} @@ -507,6 +453,88 @@ function CompetitiveSignalsPanel({ signals }: { signals: CompetitiveSignal[] }) ); } +function SignalRow({ signal: s, expanded, onToggle }: { signal: CompetitiveSignal; expanded: boolean; onToggle: () => void }) { + const { data: doc } = useDocument(s.source_document_id); + const docLabel = doc?.title ?? `doc:${s.source_document_id.slice(0, 8)}…`; + + return ( +
+
+
+ COMPETITIVE + {s.source_ticker} + + + +
+
+ e.stopPropagation()} + title={doc?.title ?? s.source_document_id} + > + {docLabel} + + + {new Date(s.computed_at).toLocaleDateString()} +
+
+ {expanded && ( + +
+
+
Source Ticker
+
{s.source_ticker}
+
+
+
Target Ticker
+
{s.target_ticker}
+
+
+
Catalyst Type
+
{s.catalyst_type}
+
+
+
Pattern Confidence
+
+
+
+
Signal Strength
+
+
+
+
Relationship Strength
+
+
+
+
Source Document
+
+ e.stopPropagation()} + > + {docLabel} + +
+
+
+
Computed At
+
{new Date(s.computed_at).toLocaleString()}
+
+
+
+ )} +
+ ); +} + function DecisionsPanel({ decisions }: { decisions: CorporateDecision[] }) { return (