text: 
  import React, { useState } from 'react';
  import { useIntl } from 'react-intl';
  import { DownloadButton } from '@redhat-cloud-services/frontend-components-pdf-generator';
  import { getExecutiveReport } from '../../../Helpers/APIHelper';
  import messages from '../../../Messages';
  import buildExecReport from './BuildExecReport';
  import { Fragment } from 'react';
  import { useDispatch } from 'react-redux';
  import { Text } from '@react-pdf/renderer';
  import { addNotification, clearNotifications } from '@redhat-cloud-services/frontend-components-notifications/redux';
  import { useNotification } from '../../../Helpers/Hooks';
  
  import styles from './Common/styles';
  
  const DownloadExecutive = () => {
      const intl = useIntl();
      const [isLoading, setLoading] = useState(false);
      const [renderPDF, setRenderPDF] = useState(false);
      const [securityRulesPresent, setSecurityRulesPresent] = useState(false);
      const addNotification = useNotification();
  
      const dispatch = useDispatch();
  
      const dataFetch = async () => {
          setLoading(true);
  
          addNotification({ msg: intl.formatMessage(messages.downloadExecutiveNotification) });
  
          const data = await getExecutiveReport();
          const report = buildExecReport({ data, intl });
          setSecurityRulesPresent(() => data.top_cves.some(cve => cve.security_rule === true));
  
          setLoading(false);
          return [...report];
      };
  
      const [date] = new Date().toISOString().split('T');
  
      const handleDownloadButton = () => {
          setRenderPDF(true);
      };
  
      return (<Fragment>
          <a onClick={() => handleDownloadButton()}>
              {intl.formatMessage(messages.executiveReportCardButton)}
          </a>
          { renderPDF && <DownloadButton
              groupName="Red Hat Insights"
              showButton={false}
              label={isLoading ? intl.formatMessage(messages.loading) : intl.formatMessage(messages.executiveReportCardButton)}
              asyncFunction={dataFetch}
              buttonProps={{ variant: 'link', isInline: true }}
              type={intl.formatMessage(messages.vulnerabilitiesHeader)}
              fileName={`vulnerability_executive-report--${date}.pdf`}
              allPagesHaveTitle={false}
              onSuccess={() => {
                  dispatch(clearNotifications());
                  setRenderPDF(false);
              }}
              footer={
                  securityRulesPresent && (
                      <Text style={styles.footer}>
                          {intl.formatMessage(messages.customReportFooter)}
                      </Text>
                  )
              }
          />
          }
      </Fragment>
      );
  
  };
  
  export default DownloadExecutive;
  