function ExportMapModalFactory()

in src/components/modals/export-map-modal/export-map-modal.js [46:112]


function ExportMapModalFactory(ExportHtmlMap, ExportJsonMap) {
  const ExportMapModalUnmemoized = ({
    config = {},
    onChangeExportData = NO_OP,
    onChangeExportMapFormat = format => {},
    onChangeExportMapHTMLMode = NO_OP,
    onEditUserMapboxAccessToken = NO_OP,
    options = {format: ''}
  }) => (
    <StyledModalContent className="export-map-modal">
      <div style={style}>
        <StyledExportMapSection>
          <div className="description">
            <div className="title">
              <FormattedMessage id={'modal.exportMap.formatTitle'} />
            </div>
            <div className="subtitle">
              <FormattedMessage id={'modal.exportMap.formatSubtitle'} />
            </div>
          </div>
          <div className="selection">
            {EXPORT_MAP_FORMAT_OPTIONS.map(op => (
              <StyledType
                key={op.id}
                selected={options.format === op.id}
                available={op.available}
                onClick={() => op.available && onChangeExportMapFormat(op.id)}
              >
                <FileType ext={op.label} height="80px" fontSize="11px" />

                {options.format === op.id && <CheckMark />}
              </StyledType>
            ))}
          </div>
        </StyledExportMapSection>
        {
          {
            [EXPORT_MAP_FORMATS.HTML]: (
              <ExportHtmlMap
                onChangeExportMapHTMLMode={onChangeExportMapHTMLMode}
                onEditUserMapboxAccessToken={onEditUserMapboxAccessToken}
                options={options[options.format]}
              />
            ),
            [EXPORT_MAP_FORMATS.JSON]: (
              <ExportJsonMap
                config={config}
                onChangeExportData={onChangeExportData}
                options={options[options.format]}
              />
            )
          }[
            // @ts-ignore
            options.format
          ]
        }
      </div>
    </StyledModalContent>
  );

  ExportMapModalUnmemoized.propTypes = propTypes;
  ExportMapModalUnmemoized.displayName = 'ExportMapModal';

  const ExportMapModal = React.memo(ExportMapModalUnmemoized);

  return ExportMapModal;
}