import type { ListItem } from '@superlist/shared' import { CheckIcon, ChevronDownIcon } from 'lucide-react' import { Card } from '@/components/ui/card' import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible' import type { useUpdateItem } from '@/hooks/use-items' import { ItemRow } from './item-row' type BoughtItemListProps = { items: ListItem[] updateItem: ReturnType savingIds: string[] onEdit: (item: ListItem) => void onMove: (item: ListItem) => void onDelete: (item: ListItem) => void } /** * Collapsible "Comprados (N)" section at the end of the list, folded by default so * the pending items stay in focus. Tapping an item here un-buys it and it returns * to the pending list. */ export function BoughtItemList({ items, updateItem, savingIds, onEdit, onMove, onDelete, }: BoughtItemListProps) { return (
Comprados ({items.length})
    {items.map((item) => ( onEdit(item)} onMove={() => onMove(item)} onDelete={() => onDelete(item)} /> ))}
) }