import React, { useState, useEffect } from 'react'; import { useParams, Link } from 'react-router-dom'; import { ArrowRight, Clock } from 'lucide-react'; import axios from 'axios'; import { format } from 'date-fns'; const API_URL = process.env.REACT_APP_API_URL || ''; function TransactionDetail() { const { txid } = useParams(); const [tx, setTx] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(''); useEffect(() => { fetchTransaction(); }, [txid]); const fetchTransaction = async () => { setLoading(true); setError(''); try { const response = await axios.get(`${API_URL}/api/tx/${txid}`); setTx(response.data); } catch (err) { setError(err.response?.data?.error || 'Transaction not found'); } finally { setLoading(false); } }; if (loading) { return (