"use client"; import { useState } from "react"; import Image from "next/image"; import { Button } from "@heroui/react"; import { useApp } from "@/contexts/AppContext"; import ConfirmModal from "@/components/common/ConfirmModal"; import { buttonVariants, disabledButtonClasses } from "@/lib/buttonStyles"; import { cn } from "@/lib/cn"; interface TradePanelProps { showHeader?: boolean; title?: string; subtitle?: string; } export default function TradePanel({ showHeader = false, title = "", subtitle = "", }: TradePanelProps) { const { t } = useApp(); const [sellAmount, setSellAmount] = useState(""); const [buyAmount, setBuyAmount] = useState(""); const [isConfirmModalOpen, setIsConfirmModalOpen] = useState(false); return (
{/* Header Section - Optional */} {showHeader && (

{title}

{subtitle}

)} {/* Trade Panel */}
{/* SELL and BUY Container with Exchange Icon */}
{/* SELL Section */}
{/* Label and Buttons */}
{t("alp.sell")}
{/* Input Row */}
setSellAmount(e.target.value)} className="w-full text-left text-[32px] font-bold leading-[130%] tracking-[-0.01em] text-text-primary dark:text-white placeholder:text-[#d1d5db] dark:placeholder:text-gray-500 bg-transparent border-none outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" /> $10,000.00 USD
45,230.00 USDC
{/* Exchange Icon */}
Exchange
{/* BUY Section */}
{/* Label */}
{t("alp.buy")}
{/* Input Row */}
setBuyAmount(e.target.value)} className="w-full text-left text-[32px] font-bold leading-[130%] tracking-[-0.01em] text-text-primary dark:text-white placeholder:text-[#d1d5db] dark:placeholder:text-gray-500 bg-transparent border-none outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none" /> $10,000.00 USD
45,230.00 USDC
{/* Submit Button */} {/* Rate Info */}
1 USDC = 0.99 YTGY ($1.00)
-$5.30
{/* Confirm Modal */} setIsConfirmModalOpen(false)} />
); }