## Summary

17
files changed
+812 / −419
lines
4
verify iterations

## Files

src/components/Cart.tsx+184 · −96
src/components/Checkout.tsx+212 · −108
src/hooks/useCartStore.ts+91 · −0
src/lib/api.ts+44 · −61
tests/Cart.test.tsx+148 · −0
package.json+8 · −12

## Representative diff · Cart.tsx

    @@ src/components/Cart.tsx
    - $('#cart-list').on('click', '.remove', function () {
    -   const id = $(this).data('id');
    -   removeItem(id);
    - });
    + function Cart({ items, onRemove }: CartProps) {
    +   return (
    +     <ul className="cart-list">
    +       {items.map((item) => (
    +         <CartRow key={item.id} item={item} onRemove={onRemove} />
    +       ))}
    +     </ul>
    +   );
    + }

## Checks

tsc --noEmit · 0 errors
vitest run · 42 passed
vite build · 312 KiB · 1.4 s
eslint . · 0 warnings