import React, { useState, useEffect } from 'react'; export default function HistoryPage() { const [txs, setTxs] = useState([]); const [loading, setLoading] = useState(true); const [query, setQuery] = useState(''); const [rag, setRag] = useState([]); const [searching, setSearching] = useState(false); useEffect(() => { load(); }, []); const load = async () => { setLoading(true); try { if (window.solvox) { const r = await window.solvox.wallet.getHistory(20); if (r.success) setTxs(r.history || []); } } catch {} setLoading(false); }; const search = async () => { if (!query.trim()) return; setSearching(true); try { if (window.solvox) { const r = await window.solvox.rag.search(query, 'transaction'); if (r.success) setRag(r.results || []); } } catch {} setSearching(false); }; return (

Transactions

{/* AI Search */}
setQuery(e.target.value)} onKeyDown={e => e.key === 'Enter' && search()} placeholder='Search with AI — "last payment to Alice"' className="search-pill flex-1 text-body-sm" />
Semantic search via @qvac/embed-llamacpp — 100% local
{rag.length > 0 && (
AI Results
{rag.map((r, i) => (
{r.text}
{(r.score * 100).toFixed(0)}% match
))}
)}
{/* Table */}
{loading ? (
Loading…
) : txs.length === 0 ? (
No transactions yet
Send or receive tokens to see history.
) : (
{txs.map((tx, i) => (
{tx.status === 'success' ? '✓' : '✗'}
{tx.signature?.slice(0, 20)}…
{tx.timestamp ? new Date(tx.timestamp).toLocaleString() : 'Pending'}
{tx.status} View →
))}
)}
); }