+ {/* Search bar */}
+
+
+
+ setInputValue(e.target.value)}
+ className="input text-sm pl-10 py-2 w-full"
+ />
+
+ {searchTerm && (
+
+ )}
+
+
+ {/* Results */}
+ {!searchTerm ? (
+
+
+
Type an underlying to find matching patterns
+
+ {['EUR/USD', 'USO', 'GLD', 'CL=F', 'GC=F', 'SPY', 'TLT'].map(example => (
+
+ ))}
+
+
+ ) : results.length === 0 ? (
+
+
+
No patterns found for {searchTerm}
+
+ ) : (
+ <>
+
+ {results.length} pattern{results.length !== 1 ? 's' : ''} influence{' '}
+ {searchTerm}, ranked by probability
+
+
+ {results.map(p => (
+
+ ))}
+
+ >
+ )}
+
+ )
+}
+
+// ── Page root ─────────────────────────────────────────────────────────────────
+
+type ViewMode = 'tree' | 'instrument'
+
+export default function PatternExplorer() {
+ const [view, setView] = useState