import * as React from 'react'; import { styled } from '@mui/material/styles'; import Chip from '@mui/material/Chip'; import Paper from '@mui/material/Paper'; import TagFacesIcon from '@mui/icons-material/TagFaces'; interface ChipData { key: number; label: string; } const ListItem = styled('li')(({ theme }) => ({ margin: theme.spacing(0.5), })); export default function ChipsArray() { const [chipData, setChipData] = React.useState([ { key: 0, label: 'Angular' }, { key: 1, label: 'jQuery' }, { key: 2, label: 'Polymer' }, { key: 3, label: 'React' }, { key: 4, label: 'Vue.js' }, ]); const handleDelete = (chipToDelete: ChipData) => () => { setChipData((chips) => chips.filter((chip) => chip.key !== chipToDelete.key)); }; return ( {chipData.map((data) => { let icon; if (data.label === 'React') { icon = ; } return ( ); })} ); }