"use client"; import { Alert, Button, Card } from "@heroui/react"; import type { CheckoutValidationResult } from "@/lib/checkout/types"; import { CheckoutLineItems } from "../content/CheckoutLineItems"; import { CheckoutOrderSummary } from "../content/CheckoutOrderSummary"; type CartValidationStepProps = { result: CheckoutValidationResult; onProceed: () => void; onBackToCart: () => void; }; export function CartValidationStep({ result, onProceed, onBackToCart, }: CartValidationStepProps) { const hasBlockingIssues = !result.valid; const hasPriceWarnings = result.valid && result.issues.some((i) => i.type === "price_changed"); const itemCount = result.items.reduce((sum, i) => sum + i.quantity, 0); const issueBannerId = "checkout-issue-banner"; return (
{/* Issue banners */} {hasBlockingIssues && ( Some items need attention Please return to your cart to resolve the issues below, then try again. )} {hasPriceWarnings && ( Prices updated Some prices have changed since you added items. The current prices are shown below. )} {/* Two-column on lg: items + sticky summary/actions */}
{/* Line items */}
{/* Summary + actions sidebar */}
); }