diff --git a/src/private/catalogs/products/ProductCollections.jsx b/src/private/catalogs/products/ProductCollections.jsx index 0f7e065..da5d651 100644 --- a/src/private/catalogs/products/ProductCollections.jsx +++ b/src/private/catalogs/products/ProductCollections.jsx @@ -192,7 +192,7 @@ export default function ProductCollections() { borderRadius: 2, p: 1, }} - onClick={() => handleEditClick(params)} + onClick={() => { setEditRow(p.row); setOpen(true); }} > @@ -237,9 +237,44 @@ export default function ProductCollections() { }, { field: 'currency', headerName: 'Currency', width: 120, valueGetter: (p) => labelCurrency(p?.row?.currency) }, { field: 'stock', headerName: 'Stock', width: 100, type: 'number', valueGetter: (p) => Number(p?.row?.stock ?? 0) }, - { field: 'attributes.material', headerName: 'Material', width: 150, valueGetter: (p) => labelMaterial(p?.row?.attributes?.material) }, - { field: 'attributes.legs', headerName: 'Legs', width: 140, valueGetter: (p) => labelLegs(p?.row?.attributes?.legs) }, - { field: 'attributes.origin', headerName: 'Origin', width: 150, valueGetter: (p) => labelOrigin(p?.row?.attributes?.origin) }, + { + field: 'attributes', + headerName: 'Attributes', + minWidth: 300, + flex: 1.5, + sortable: false, + filterable: false, + renderCell: (params) => { + const a = params?.row?.attributes || {}; + const chips = [ + ['Material', labelMaterial(a.material)], + ['Legs', labelLegs(a.legs)], + ['Origin', labelOrigin(a.origin)], + ].filter(([, value]) => !!value); + + return ( + + {chips.map(([label, value]) => ( + + {label}: {value} + + ))} + + ); + } + }, { field: 'status', headerName: 'Status', width: 120 } ]; @@ -247,7 +282,7 @@ export default function ProductCollections() { - Furniture Variants + Product Collection Inactive