MCPcopy Create free account
hub / github.com/Thanas-R/Virdis / handleSave

Function handleSave

src/components/NewFieldDialog.tsx:147–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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>);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected