import { ExternalLink } from '@automattic/components'; import { useLocale, localizeUrl } from '@automattic/i18n-utils'; import AntispamIcon from '../icons/jetpack-bundle-icon-antispam'; import BackupIcon from '../icons/jetpack-bundle-icon-backup'; import BlazeIcon from '../icons/jetpack-bundle-icon-blaze'; import BoostIcon from '../icons/jetpack-bundle-icon-boost'; import CRMIcon from '../icons/jetpack-bundle-icon-crm'; import NewsletterIcon from '../icons/jetpack-bundle-icon-newsletter'; import ScanIcon from '../icons/jetpack-bundle-icon-scan'; import SearchIcon from '../icons/jetpack-bundle-icon-search'; import SocialIcon from '../icons/jetpack-bundle-icon-social'; import StatsIcon from '../icons/jetpack-bundle-icon-stats'; import VideopressIcon from '../icons/jetpack-bundle-icon-videopress'; import { onLinkClick } from '../utils'; import type { FC, MouseEvent } from 'react'; interface BundleType { bundle: { id: string; label: string; href: string; }; } const Bundle: FC< BundleType > = ( { bundle } ) => { const locale = useLocale(); const { href, label, id } = bundle; const onBundlesLinkClick = ( e: MouseEvent< HTMLAnchorElement > ) => { onLinkClick( e, 'calypso_jetpack_nav_bundles_click' ); }; const getBundleIcons = ( bundle: string ) => { // Using a soft match in case the menu item gets deleted and recreated in wp-admin // causing the name to change to `complete-2` or something similar. if ( bundle.includes( 'complete' ) ) { return [ , , , , , , , , ]; } if ( bundle.includes( 'security' ) ) { return [ , , , ]; } if ( bundle.includes( 'growth' ) ) { return [ , , , , ]; } return []; }; return (
  • { label }

    { getBundleIcons( id ).map( ( icon, index ) => ( { icon } ) ) }
  • ); }; export default Bundle;