Skip to content

Commit 551256d

Browse files
Add switch to raw view when transaction decoding fails
Co-authored-by: joaquim.verges <[email protected]>
1 parent 22c30ad commit 551256d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/transactions/tx/[id]/transaction-details-ui.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,10 @@ function TransactionParametersCard({
400400
/>
401401

402402
{activeTab === "decoded" ? (
403-
<DecodedTransactionDisplay decodedData={decodedTransactionData} />
403+
<DecodedTransactionDisplay
404+
decodedData={decodedTransactionData}
405+
onSwitchToRaw={() => setActiveTab("raw")}
406+
/>
404407
) : (
405408
<div>
406409
{transaction.transactionParams &&
@@ -424,14 +427,24 @@ function TransactionParametersCard({
424427
// Client component to display decoded transaction data
425428
function DecodedTransactionDisplay({
426429
decodedData,
430+
onSwitchToRaw,
427431
}: {
428432
decodedData: DecodedTransactionData;
433+
onSwitchToRaw: () => void;
429434
}) {
430435
if (!decodedData) {
431436
return (
432437
<p className="text-muted-foreground text-sm">
433438
Unable to decode transaction data. The contract may not have verified
434-
metadata available.
439+
metadata available.{" "}
440+
<button
441+
onClick={onSwitchToRaw}
442+
className="text-foreground underline-offset-4 hover:underline cursor-pointer"
443+
type="button"
444+
>
445+
View raw transaction data
446+
</button>
447+
.
435448
</p>
436449
);
437450
}

0 commit comments

Comments
 (0)