import Link from "next/link"; import { MapPin } from "lucide-react"; import type { Address, AddressLabel } from "@/types/api"; const ADDRESS_LABEL_FA: Record = { home: "خانه", work: "محل کار", other: "سایر", }; /** * Both actions carry `returnTo` (the checkout confirm page's own URL) so the whole * address-management chain — map → details form → address list — comes back here * instead of stranding the customer on /addresses mid-checkout. */ export function CheckoutAddress({ address, returnTo, }: { address: Address | null; returnTo: string; }) { const next = encodeURIComponent(returnTo); return (

آدرس تحویل

{address ? (
{/* DOM order intentionally mirrors the screenshot's left→right layout — see the inherited dir="rtl" note on the /cart page. */}
{address.title || ADDRESS_LABEL_FA[address.label]}

{address.full_address}

تغییر آدرس
) : (

هنوز آدرسی ثبت نکرده‌اید. برای ادامه سفارش، لطفاً یک آدرس اضافه کنید.

)}
); }