message: Prevent unecessary rerenders in the company suggestion modal
diff: @@ -126,11 +126,13 @@ const CompanySuggestionsPack = ({ pack }: CompanySuggestionsPackProps) => {
  const [batch, appendToBatchBySlug] = useGeneratorStore((state) => [state.batch, state.appendToBatchBySlug]);
  + const ModalContent = () => {
  const [selectedCompanies, setSelectedCompanies] = useState(
  pack.type === 'choose' ? [] : pack.companies.map((c) => c.slug)
  );
  - const [Modal, showModal, hideModal] = useModal(
  + return (
  + <IntlProvider scope="generator" definition={window.I18N_DEFINITION}>
  <>
  <h1>{t(`${pack.slug as 'address-brokers'}-title`, 'company-packs')}</h1>
  @@ -158,22 +160,28 @@ const CompanySuggestionsPack = ({ pack }: CompanySuggestionsPackProps) => {
  );
  })}
  </ul>
  - </>,
  - {
  - positiveText: t(
  - 'add-n-companies',
  - 'generator',
  - { n: `${selectedCompanies.length}` },
  - selectedCompanies.length
  - ),
  - onPositiveFeedback: () =>
  + <button
  + className="button button-primary"
  + style="float: right"
  + onClick={() =>
  Promise.all(
  selectedCompanies
  .filter((slug) => !Object.keys(batch || {}).includes(slug))
  .map((slug) => appendToBatchBySlug(slug))
  - ).then(hideModal),
  - }
  + ).then(hideModal)
  + }>
  + <Text
  + id="add-n-companies"
  + fields={{ n: `${selectedCompanies.length}` }}
  + plural={selectedCompanies.length}
  + />
  + </button>
  + </>
  + </IntlProvider>
  );
  + };
  +
  + const [Modal, showModal, hideModal] = useModal(<ModalContent />);
  return (
  <IntlProvider scope="company-packs" definition={window.I18N_DEFINITION}>
  