diff --git a/frontend/src/pages/Admin/AdminProducts.js b/frontend/src/pages/Admin/AdminProducts.js index 6c45671..2d8447a 100644 --- a/frontend/src/pages/Admin/AdminProducts.js +++ b/frontend/src/pages/Admin/AdminProducts.js @@ -425,6 +425,61 @@ const AdminProducts = () => { )} + {/* Seed Blend Editor */} + {formData.productType === 'seed' && ( +
+
+ + +
+ {(formData.seedBlend||[]).length === 0 ? ( +
No cultivars added yet.
+ ) : ( +
+ {formData.seedBlend.map((row, idx) => ( +
+ { + const next = [...formData.seedBlend]; + next[idx] = { ...next[idx], cultivar: e.target.value }; + setFormData({ ...formData, seedBlend: next }); + }} + /> + { + const next = [...formData.seedBlend]; + next[idx] = { ...next[idx], percent: e.target.value }; + setFormData({ ...formData, seedBlend: next }); + }} + /> + +
+ ))} +
+ Total: {((formData.seedBlend||[]).reduce((s,r)=> s + (parseFloat(r.percent)||0), 0)).toFixed(1)}% +
+
+ )} +
+ )} +
{formData.rates.map((rate, index) => (
-
+
+ updateRate(index, 'applicationType', e.target.value)} + className="px-2 py-1 border border-gray-300 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-500" + />