"use client" import { HttpTypes } from "@medusajs/types" import { cn } from "@/lib/utils" import Item from "@modules/cart/components/item" type ItemsTemplateProps = { cart: HttpTypes.StoreCart } /** Compact item list for the checkout summary */ const ItemsPreviewTemplate = ({ cart }: ItemsTemplateProps) => { const items = [...(cart.items ?? [])].sort((a, b) => (a.created_at ?? "") > (b.created_at ?? "") ? -1 : 1 ) const hasOverflow = items.length > 4 return (