<.shop_layout {layout_assigns(assigns)} active_page="checkout">
<%= if @order && @order.payment_status == "paid" do %>

Thank you for your order

Order {@order.order_number}

<%= if @order.customer_email do %>

A confirmation will be sent to {@order.customer_email}

<% end %>
<.shop_card class="checkout-card">

Order details

Total {Berrypod.Cart.format_price(@order.total)}
<%= if @order.shipping_address != %{} do %> <.shop_card class="checkout-card">

Shipping to

{@order.shipping_address["name"]}

{@order.shipping_address["line1"]}

<%= if @order.shipping_address["line2"] do %>

{@order.shipping_address["line2"]}

<% end %>

{@order.shipping_address["city"]}, {@order.shipping_address["postal_code"]}

{@order.shipping_address["country"]}

<% end %>
<.shop_link_button href="/collections/all" class="checkout-cta"> Continue shopping
<% else %> <%!-- Payment pending or order not found --%>

Processing your payment

Please wait while we confirm your payment. This usually takes a few seconds.

If this page doesn't update, please <.link navigate="/contact" class="checkout-contact-link" >contact us.

<% end %>