(
additionalFilters?: (item: QuickStartPackages) => boolean
)
| 121 | |
| 122 | // Get summary packages for game type grouping |
| 123 | const getSummaryPackages = ( |
| 124 | additionalFilters?: (item: QuickStartPackages) => boolean |
| 125 | ): QuickStartPackages[] => { |
| 126 | let filteredPackages = getFilteredPackages(additionalFilters); |
| 127 | if (searchForm.gameType === SEARCH_ALL_KEY) { |
| 128 | const map = new Map<string, QuickStartPackages>(); |
| 129 | filteredPackages.forEach((item) => { |
| 130 | if (!map.has(item.gameType)) { |
| 131 | const summary: QuickStartPackages = { |
| 132 | ...item, |
| 133 | key: JSON.stringify({ |
| 134 | title: item.title, |
| 135 | language: item.language, |
| 136 | platform: item.platform, |
| 137 | gameType: item.gameType, |
| 138 | targetLink: item.targetLink, |
| 139 | category: item.category |
| 140 | }), |
| 141 | description: "", |
| 142 | title: item.gameType, |
| 143 | category: "", |
| 144 | runtime: "", |
| 145 | size: "", |
| 146 | hardware: "", |
| 147 | remark: "", |
| 148 | targetLink: undefined, |
| 149 | author: "", |
| 150 | setupInfo: undefined as any, |
| 151 | tags: undefined, |
| 152 | isSummary: true |
| 153 | }; |
| 154 | map.set(item.gameType, summary); |
| 155 | } else { |
| 156 | const existing = map.get(item.gameType); |
| 157 | if (existing) { |
| 158 | if (existing.platform !== item.platform) { |
| 159 | existing.platform = "All"; |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | }); |
| 164 | filteredPackages = Array.from(map.values()); |
| 165 | } |
| 166 | |
| 167 | return filteredPackages; |
| 168 | }; |
| 169 | |
| 170 | // Generic function to generate options list for select dropdowns |
| 171 | const generateOptionsList = ( |
no test coverage detected