我現在有很多資料 然後用map的方式把資料取出
如下 會有很多張卡片(我是用material-ui的card)

點擊打開
現在有一個問題是 我按下去後 每一張卡片都會被打開
請問如果我想 只打開某一張卡片的內容該怎麼做呢
  const [expanded, setExpanded] = React.useState(false);
  const handleExpandClick = () => {
    setExpanded(!expanded);
  };
        <IconButton
          className={clsx(classes.expand, {
            [classes.expandOpen]: expanded,
          })}
          onClick={handleExpandClick}
          aria-expanded={expanded}
          aria-label="show more"
        >
上面是文件提供的程式碼
雖然我沒寫 react 但這個問題我覺得十之八九要用 id 解
請指定要觸發的 id
大概會是像下面的樣子,實際上能不能動我不清楚,但大致上就是透過傳遞event去取得目前點擊的class裡有沒有"expandOpen"這個class
  const [expanded, setExpanded] = React.useState(false);
  const handleExpandClick = (e) => {
    const expandedState = e.target.className.includes("expandOpen")
    setExpanded(!expandedState);
  };
        <IconButton
          className={clsx(classes.expand, {
            [classes.expandOpen]: false,
          })}
          onClick={handleExpandClick(e)}
          aria-expanded={false}
          aria-label="show more"
        >
熟悉react的應該可以用 bind 和 this 來解。