import { useTranslation } from "react-i18next"; import { LucideIcon } from "../../lib/iconData"; interface ReviewItem { id: number; brand: string | null; model: string; imageUrl: string | null; category: string | null; } interface OnboardingReviewProps { items: ReviewItem[]; onRemoveItem: (itemId: number) => void; onConfirm: () => void; onSkip: () => void; isSubmitting: boolean; } export function OnboardingReview({ items, onRemoveItem, onConfirm, onSkip, isSubmitting, }: OnboardingReviewProps) { const { t } = useTranslation("onboarding"); // Group by category const grouped = new Map(); for (const item of items) { const cat = item.category || "Uncategorized"; if (!grouped.has(cat)) grouped.set(cat, []); grouped.get(cat)!.push(item); } return (

{t("review.title")}

{items.length > 0 ? t("review.itemsReady", { count: items.length }) : t("review.noItemsSelected")}

{items.length > 0 && (
{[...grouped.entries()].map(([category, catItems]) => (
{category}
{catItems.map((item) => (
{item.imageUrl ? ( {item.model} ) : (
)}
{item.brand ? `${item.brand} ${item.model}` : item.model}
))}
))}
)}
{items.length > 0 ? ( ) : ( )} {items.length > 0 && ( )}
); }