+ {/* Close button for final states */}
+ {(state === "success" || state === "failure") && (
+
+ )}
+
+ {/* State Icon Indicator */}
+
+ {state === "success" &&
}
+ {state === "failure" &&
}
+ {(state === "submitting" || state === "confirming") && (
+
+ )}
+
+
+ {/* Status Messaging */}
+
+
+ {state === "submitting" && "Sign Transaction"}
+ {state === "confirming" && "Confirming on Ledger"}
+ {state === "success" && "Transaction Successful"}
+ {state === "failure" && "Transaction Failed"}
+
+
+ {state === "submitting" && "Please approve the transaction in your Freighter wallet extension."}
+ {state === "confirming" &&
+ `Broadcasting to Stellar. Waiting for ledger confirmation... (poll #${pollCount})`}
+ {state === "success" &&
+ `Your transaction has been confirmed on the Stellar network.`}
+ {state === "failure" && (displayError || "An unexpected error occurred.")}
+
+
+
+ {/* Transaction Info Panel */}
+
+
+ Transaction Type
+
+ {actionType}
+
+
+
+
+ Amount
+
+ {amount.toFixed(2)} USDC
+
+
+
+ {txHash && (
+
+
Transaction Hash
+
+
+ {truncateHash(txHash)}
+
+
+
+
+ )}
+
+
+ {/* Action Button */}
+
+ {state === "success" && (
+
+ )}
+
+ {state === "failure" && (
+
+ )}
+
+ {(state === "submitting" || state === "confirming") && (
+
+ )}
+
+
+ {/* Local styling for animations */}
+
+