File size: 772 Bytes
7aa4c01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var dagcomponentfuncs = (window.dashAgGridComponentFunctions =
  window.dashAgGridComponentFunctions || {});

dagcomponentfuncs.statusCellRenderer = function (params) {
  // You may want to sync this color map with your Python COLOR_MAP_STATUS
  var colorMap = {
    "In Transit": "#1a85ff",
    Processing: "#f6c343",
    Delivered: "#60c96c",
  };
  var color = colorMap[params.value] || "#ccc";
  return React.createElement(
    "div",
    { style: { display: "flex", alignItems: "center", gap: "8px" } },
    React.createElement("span", {
      style: {
        display: "inline-block",
        width: "12px",
        height: "12px",
        background: color,
        borderRadius: "50%",
      },
    }),
    React.createElement("span", null, params.value),
  );
};