import React from "react"; import { useTheme } from "@/context"; import { formatUnits } from "ethers"; import type { Quote } from "@moonup/moon-api"; interface SwapDetailsProps { quoteResult: Quote; fromToken: any; toToken: any; slippage: number; } export const SwapDetails: React.FC = ({ quoteResult, fromToken, toToken, slippage, }) => { const theme = useTheme(); const { estimate } = quoteResult; const gasCost = estimate.gasCosts.reduce( (total, cost) => total + Number(formatUnits(cost.amount, cost.token.decimals)), 0, ); const exchangeRate = Number(estimate.toAmount) / Number(estimate.fromAmount); return (

Transaction Details

{quoteResult.includedSteps.length > 1 && ( step.tool) .join(" > ")} /> )}
); }; const DetailRow: React.FC<{ label: string; value: string }> = ({ label, value, }) => { const theme = useTheme(); return (
{label} {value}
); };