Antigravity AI commited on
Commit
d95efd6
·
1 Parent(s): 9d7bd77

Fix image upload in add product form

Browse files
src/components/admin/MenuEditor.jsx CHANGED
@@ -165,6 +165,13 @@ export default function MenuEditor() {
165
  {['Entradas', 'Bebidas', 'Fuertes', 'Postres', 'Pizzas', 'Combos'].map(c => <option key={c} value={c}>{c}</option>)}
166
  </select>
167
  </div>
 
 
 
 
 
 
 
168
  <div style={{ display: 'flex', gap: '0.5rem' }}>
169
  <button type="button" onClick={() => addIngredientToProduct(false)} className="btn-glass" style={{ flex: 1, padding: '0.8rem' }}>
170
  <ListTree size={18} /> Insumos
 
165
  {['Entradas', 'Bebidas', 'Fuertes', 'Postres', 'Pizzas', 'Combos'].map(c => <option key={c} value={c}>{c}</option>)}
166
  </select>
167
  </div>
168
+ <div>
169
+ <label style={labelStyle}>Imagen del Platillo</label>
170
+ <label style={{ ...inputStyle, display: 'flex', alignItems: 'center', justifyContent: 'center', gap: '0.5rem', cursor: 'pointer', background: formData.image ? 'rgba(76,217,100,0.1)' : 'rgba(255,255,255,0.05)', color: formData.image ? 'var(--success)' : '#fff', border: formData.image ? '1px solid var(--success)' : '1px solid var(--border-subtle)' }}>
171
+ <Upload size={18} /> {uploading ? 'Subiendo...' : (formData.image ? '¡Imagen Lista!' : 'Subir Imagen')}
172
+ <input type="file" hidden onChange={e => handleImageUpload(e, false)} accept="image/*" />
173
+ </label>
174
+ </div>
175
  <div style={{ display: 'flex', gap: '0.5rem' }}>
176
  <button type="button" onClick={() => addIngredientToProduct(false)} className="btn-glass" style={{ flex: 1, padding: '0.8rem' }}>
177
  <ListTree size={18} /> Insumos