{action == null ? (
  <Typography>No action recorded</Typography>
) : (
  <Typography>
    Last action: {action.isExpanded ? 'expand' : 'collapse'} {action.itemId}
  </Typography>
)}
<Box sx={{ minHeight: 352, minWidth: 250 }}>
  <RichTreeView
    items={MUI_X_PRODUCTS}
    onItemExpansionToggle={handleItemExpansionToggle}
  />
</Box>