diff --git a/src/private/AddOrEditProductForm.jsx b/src/private/AddOrEditProductForm.jsx index 9180980..ce3c591 100644 --- a/src/private/AddOrEditProductForm.jsx +++ b/src/private/AddOrEditProductForm.jsx @@ -34,7 +34,7 @@ export default function AddOrEditProductForm({ onAdd, initialData, onCancel }) { })); }; - const handleImageChange = (e) => { + const handleImageChange = (e) => { const file = e.target.files[0]; if (!file) return; @@ -101,37 +101,72 @@ export default function AddOrEditProductForm({ onAdd, initialData, onCancel }) { onChange={handleChange} margin="normal" /> - - {product.representation && ( - - Representation - - - )} - - - - - {/* Fields... */} - - - + + {product.representation && ( + + Representation + + + )} + + + + + {/* Fields... */} + + + + - ); } \ No newline at end of file diff --git a/src/private/Admin.jsx b/src/private/Admin.jsx index 9a7c222..2958cb5 100644 --- a/src/private/Admin.jsx +++ b/src/private/Admin.jsx @@ -16,36 +16,36 @@ const columnsBase = [ { field: 'stock', headerName: 'Stock', width: 100, type: 'number' }, { field: 'category', headerName: 'Category', flex: 1 }, { - field: 'representation', - headerName: 'Representation', - width: 120, - renderCell: (params) => ( - - ( + + + + ) } - }} - /> - - ) - } ]; export default function Admin({ children, maxWidth = 'lg', sx = {} }) { const [rows, setRows] = useState([ - { id: 1, company: 'Fendi casa', name: 'Product 1', price: 10.99, provider: 'Provider A', stock: 100, category: 'Home', representation: '/favicon.png' }, - { id: 2, company: 'Fendi casa', name: 'Product 2', price: 20.0, provider: 'Provider B', stock: 50, category: 'Home', representation: '/logo.png' }, - { id: 3, company: 'Fendi casa', name: 'Product 3', price: 5.5, provider: 'Provider C', stock: 200, category: 'Home', representation: '/background.jpg' }, - { id: 4, company: 'Fendi casa', name: 'Product 4', price: 15.75, provider: 'Provider D', stock: 30, category: 'Home', representation: '/background.jpg' }, - { id: 5, company: 'Fendi casa', name: 'Product 5', price: 8.2, provider: 'Provider E', stock: 75, category: 'Home', representation: '/favicon.png' } - ]); + { id: 1, company: 'Fendi casa', name: 'Product 1', price: 10.99, provider: 'Provider A', stock: 100, category: 'Home', representation: '/favicon.png' }, + { id: 2, company: 'Fendi casa', name: 'Product 2', price: 20.0, provider: 'Provider B', stock: 50, category: 'Home', representation: '/logo.png' }, + { id: 3, company: 'Fendi casa', name: 'Product 3', price: 5.5, provider: 'Provider C', stock: 200, category: 'Home', representation: '/background.jpg' }, + { id: 4, company: 'Fendi casa', name: 'Product 4', price: 15.75, provider: 'Provider D', stock: 30, category: 'Home', representation: '/background.jpg' }, + { id: 5, company: 'Fendi casa', name: 'Product 5', price: 8.2, provider: 'Provider E', stock: 75, category: 'Home', representation: '/favicon.png' } + ]); const [open, setOpen] = useState(false); const [editingProduct, setEditingProduct] = useState(null); @@ -109,7 +109,7 @@ export default function Admin({ children, maxWidth = 'lg', sx = {} }) { { setOpen(false); setEditingProduct(null); }} maxWidth="sm" fullWidth> {editingProduct ? 'Edit Product' : 'Add Product'} - { setOpen(false); setEditingProduct(null); }}/> + { setOpen(false); setEditingProduct(null); }} /> @@ -121,8 +121,30 @@ export default function Admin({ children, maxWidth = 'lg', sx = {} }) { {rowToDelete?.name}? - - + + @@ -136,7 +158,18 @@ export default function Admin({ children, maxWidth = 'lg', sx = {} }) { /> -