import { Grid } from "@material-ui/core"; import React from "react"; import { StatusChip } from "./StatusChip"; const StateCounter = ({ type, list, }: { type: string; list: { state: string }[]; }) => { const stateMap = {} as { [state: string]: number }; list.forEach(({ state }) => { stateMap[state] = stateMap[state] + 1 || 1; }); return ( {Object.entries(stateMap).map(([s, num]) => ( ))} ); }; export default StateCounter;