1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @flow
    
  8.  */
    
  9. 
    
  10. import * as React from 'react';
    
  11. import styles from './HocBadges.css';
    
  12. 
    
  13. import type {Element} from 'react-devtools-shared/src/frontend/types';
    
  14. 
    
  15. type Props = {
    
  16.   element: Element,
    
  17. };
    
  18. 
    
  19. export default function HocBadges({element}: Props): React.Node {
    
  20.   const {hocDisplayNames} = ((element: any): Element);
    
  21. 
    
  22.   if (hocDisplayNames === null) {
    
  23.     return null;
    
  24.   }
    
  25. 
    
  26.   return (
    
  27.     <div className={styles.HocBadges}>
    
  28.       {hocDisplayNames !== null &&
    
  29.         hocDisplayNames.map(hocDisplayName => (
    
  30.           <div key={hocDisplayName} className={styles.Badge}>
    
  31.             {hocDisplayName}
    
  32.           </div>
    
  33.         ))}
    
  34.     </div>
    
  35.   );
    
  36. }