App.ComboCard = function ComboCard({ combo, selectable, selected, onToggle, onDelete, showDelete }) { const MAX_THUMBS = 5; const handleClick = () => { if (selectable && onToggle) onToggle(combo.id); }; const handleDelete = (e) => { e.stopPropagation(); onDelete(combo.id, combo.name); }; const show = combo.cars ? combo.cars.slice(0, MAX_THUMBS) : []; const overflow = (combo.cars ? combo.cars.length : 0) - MAX_THUMBS; // Category badges const catBadges = []; if (combo.categories && combo.categories.length > 0) { combo.categories.forEach(cat => { catBadges.push( All {cat.category_name} ); }); } // Creator display const creatorName = combo.creator_nickname ? combo.creator_nickname : combo.creator_id ? 'User #' + combo.creator_id : null; // Free/Paid border logic const carsAllFree = !combo.cars || combo.cars.length === 0 || combo.cars.every(c => c.is_free == 1); const catsAllFree = !combo.categories || combo.categories.length === 0 || combo.categories.every(c => c.all_free == 1); const trackFree = combo.track_config_is_free == 1; const allFree = carsAllFree && catsAllFree && trackFree; let borderClass = ''; if (allFree) borderClass = ' combo-all-free'; else borderClass = ' combo-has-paid'; return (

{combo.name}

{creatorName && (
creator[ {creatorName} ]
)}
{combo.track_name}
Track: {combo.track_name}
{show.map(car => (
{car.name} {car.name}
))} {catBadges} {overflow > 0 && +{overflow} more} {show.length === 0 && catBadges.length === 0 && ( None )}
{showDelete && ( )}
{selected &&
}
); };