"use client"; import { useState } from "react"; import Image from "next/image"; import { Modal, ModalContent, Button } from "@heroui/react"; import { buttonStyles } from "@/lib/buttonStyles"; interface WithdrawModalProps { isOpen: boolean; onClose: () => void; amount: string; } export default function WithdrawModal({ isOpen, onClose, amount, }: WithdrawModalProps) { const [showDetails, setShowDetails] = useState(true); const alpAmount = amount ? (parseFloat(amount) * 0.098).toFixed(0) : "0"; const usdValue = amount ? (parseFloat(amount) * 1.00045).toFixed(2) : "0.00"; const fee = amount ? (parseFloat(amount) * 0.005).toFixed(2) : "0.00"; const minReceive = amount ? (parseFloat(amount) * 0.098 * 0.995).toFixed(0) : "0"; return (
{/* Header */}
Review
{/* Exchange Section */}
{/* From USDC */}
{amount || "0"} USDC
≈ ${usdValue}
USDC
{/* Exchange Icon */}
Exchange
{/* To ALP */}
{alpAmount} ALP
≈ ${usdValue}
{/* Show More/Less Button */} {/* Transaction Details */} {showDetails && (
Fee(0.5%)
-${fee}
Network cost
-$0.09
Rate
1USDC=0.98ALP ($1.02)
Spread
0
Price Impact
+$0.60 (+0.065%)
Max slippage
0.5%
Min Receive
{minReceive} ALP
)}
{/* Confirm Button */}
); }