import type { OnchainTx } from './shared';
import { ArrowDownLeft, ArrowUpRight, Loader2 } from 'lucide-react';
import { toneFill, toneText } from '@/components/Data/tone';
import { formatConfirmations, formatSats, formatTimestamp, truncateMiddle } from './format';
import { TX_DIRECTION_TONE } from './shared';
import { Amount } from './Amount';
import { EmptyWallet } from './EmptyWallet';
import { SyncBadge } from './SyncBadge';
import { useSelectedWallet } from './useSelectedWallet';
import { useTransactions } from './useWalletData';
// On-chain history. Works while locked — the transaction list comes from the account xpub, not the seed.
export const TransactionsView = () => {
const { walletId, isLoading } = useSelectedWallet();
const { transactions, sync, isLoading: txLoading } = useTransactions(walletId);
if (!walletId) return
{neverRead ? 'History unavailable' : 'Nothing here yet'}
{neverRead ? (sync.lastError ?? 'The chain source could not be reached.') : 'Transactions appear as soon as they hit the mempool.'}