import React from 'react'; import { Card } from '../ui/card'; import { Tag, ShieldCheck, CreditCard } from 'lucide-react'; import { Button } from '../ui/button'; interface OrderSummaryProps { subtotal: number; taxRate?: number; discount?: { code: string; amount: number; type: 'percent' | 'fixed' }; currency?: string; onCheckout?: () => void; loading?: boolean; } export const OrderSummary: React.FC = ({ subtotal, taxRate = 0.08, discount, currency = 'USD', onCheckout, loading = false, }) => { const discountAmount = discount ? discount.type === 'percent' ? subtotal * (discount.amount / 100) : discount.amount : 0; const taxableAmount = Math.max(0, subtotal - discountAmount); const taxAmount = taxableAmount * taxRate; const total = taxableAmount + taxAmount; const formatPrice = (amount: number) => { return new Intl.NumberFormat('en-US', { style: 'currency', currency, }).format(amount); }; return (

Checkout Summary

Transaction Base {formatPrice(subtotal)}
{discount && (
Protocol: {discount.code} -{formatPrice(discountAmount)}
)}
Regulatory Levy ({(taxRate * 100).toFixed(0)}%) {formatPrice(taxAmount)}
Total Liability {formatPrice(total)}
{onCheckout && ( )}

Encrypted Node

SECURE FLOW ENABLED. DATA PACKETS ARE ENCRYPTED VIA AES-256.

); };