()
| 145 | console.warn("Crop guess failed, keeping Wheat:", e); |
| 146 | setCrop("Wheat"); |
| 147 | } finally { |
| 148 | setGuessingCrop(false); |
| 149 | } |
| 150 | } |
| 151 | }; |
| 152 | detect(); |
| 153 | }, [coordinates, mapToken]); |
| 154 | |
| 155 | const filteredCrops = cropSearch |
| 156 | ? CROP_OPTIONS.filter(c => c.name.toLowerCase().includes(cropSearch.toLowerCase()) || c.category.toLowerCase().includes(cropSearch.toLowerCase())) |
| 157 | : CROP_OPTIONS; |
| 158 | |
| 159 | const groupedCrops = CROP_CATEGORIES.reduce((acc, cat) => { |
| 160 | const crops = filteredCrops.filter(c => c.category === cat); |
| 161 | if (crops.length > 0) acc[cat] = crops; |
| 162 | return acc; |
| 163 | }, {} as Record<string, typeof CROP_OPTIONS>); |
nothing calls this directly
no outgoing calls
no test coverage detected