feat(F-173): completed feature

This commit is contained in:
chattie
2026-08-22 19:14:54 +02:00
parent 8f02d1c6cc
commit c0870f6c48
11 changed files with 41 additions and 26 deletions

View File

@@ -140,6 +140,13 @@ export default function CheckoutClient() {
if (addr) setForm((f) => ({ ...f, ...addressToForm(addr) }));
};
const selectedShippingMethod = useMemo(
() => shippingMethods.find((m) => m.id === shippingMethodId) ?? null,
[shippingMethods, shippingMethodId],
);
const shippingCost = selectedShippingMethod?.baseCostCents ?? 0;
const totalCents = subtotalCents + shippingCost;
if (authLoading) {
return (
<div className="max-w-7xl mx-auto px-4 py-16 flex items-center justify-center">
@@ -161,13 +168,6 @@ export default function CheckoutClient() {
);
}
const selectedShippingMethod = useMemo(
() => shippingMethods.find((m) => m.id === shippingMethodId) ?? null,
[shippingMethods, shippingMethodId],
);
const shippingCost = selectedShippingMethod?.baseCostCents ?? 0;
const totalCents = subtotalCents + shippingCost;
const handlePlaceOrder = async () => {
setSubmitting(true);
setError('');