import { styled, Box, Typography } from "@mui/material"; const Item = styled(Box)(({ theme }) => ({ display: "flex", padding: "4px 16px", color: theme.palette.text.primary, })); const COLOR = [ "primary", "secondary", "info", "warning", "error", "success", "text", ]; interface Props { index: number; value: IRuleItem; } const parseColor = (text: string) => { let sum = 0; for (let i = 0; i < text.length; i++) { sum += text.charCodeAt(i); } return COLOR[sum % COLOR.length]; }; const RuleItem = (props: Props) => { const { index, value } = props; return ( {index} {value.payload || "-"} {value.type} {value.proxy} ); }; export default RuleItem;