So I have a stylesheet like below
const badgeStyle = createStyles({
  badge: {
    borderRadius: "12px",
    padding: "5px 12px",
    textTransform: "uppercase",
    fontSize: "10px",
    fontWeight: 700,
    lineHeight: 1,
    color: whiteColor,
    textAlign: "center",
    verticalAlign: "baseline",
    display: "inline-block"
  },
  primary: {
    backgroundColor: primaryColor[0]
  },
  warning: {
    backgroundColor: warningColor[0]
  },
  danger: {
    backgroundColor: dangerColor[0]
  },
  success: {
    backgroundColor: successColor[0]
  },
  info: {
    backgroundColor: infoColor[0]
  },
  rose: {
    backgroundColor: roseColor[0]
  },
  gray: {
    backgroundColor: grayColor[0]
  }
});
I import that stylesheet and want you use that line below
import styles from "../../assets/jss/material-dashboard-pro-react/components/badgeStyle";
const useStyles = makeStyles(styles);
const classes = useStyles();
return (
    <span className={classes.badge + " " + classes[color]}>{children}</span>
  );
but this statement classes[color] gives me below error
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'Record<"badge" | "gray" | "primary" | "warning" | "danger" | "success" | "info" | "rose", string>'
How to use classes[color] in typescript ?