import { StoreCart, StoreCartLineItem } from '@medusajs/types'; import { Table, TableBody, TableHead, TableHeader, TableRow, } from '@kit/ui/table'; import { Trans } from '@kit/ui/trans'; import CartItem from './cart-item'; import MobileCartItems from './mobile-cart-items'; export default function CartItems({ cart, items, productColumnLabelKey, }: { cart: StoreCart; items: StoreCartLineItem[]; productColumnLabelKey: string; }) { if (!items || items.length === 0) { return null; } return ( <> {items .sort((a, b) => (a.created_at ?? '') > (b.created_at ?? '') ? -1 : 1, ) .map((item) => ( ))}
{items .sort((a, b) => (a.created_at ?? '') > (b.created_at ?? '') ? -1 : 1, ) .map((item) => ( ))}
); }