/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import * as React from 'react'; import Badge from './Badge'; import ForgetBadge from './ForgetBadge'; import IndexableDisplayName from './IndexableDisplayName'; import styles from './IndexableElementBadges.css'; type Props = { hocDisplayNames: Array | null, compiledWithForget: boolean, elementID: number, className?: string, }; export default function IndexableElementBadges({ compiledWithForget, hocDisplayNames, elementID, className = '', }: Props): React.Node { if ( !compiledWithForget && (hocDisplayNames == null || hocDisplayNames.length === 0) ) { return null; } return (
{compiledWithForget && ( )} {hocDisplayNames != null && hocDisplayNames.length > 0 && ( )} {hocDisplayNames != null && hocDisplayNames.length > 1 && (
+{hocDisplayNames.length - 1}
)}
); }