File was renamed from zy-acs-flow/src/page/code/ImportModal.jsx |
| | |
| | | import { useEffect, useState } from 'react'; |
| | | import { Box, CircularProgress, Stack, Typography } from '@mui/material'; |
| | | import Alert from '@mui/material/Alert'; |
| | | import Dialog from '@mui/material/Dialog'; |
| | |
| | | useRefresh, |
| | | } from 'react-admin'; |
| | | import { Link } from 'react-router-dom'; |
| | | import { DialogCloseButton } from '../misc/DialogCloseButton'; |
| | | import { usePapaParse } from '../misc/usePapaParse'; |
| | | import { ContactImportSchema, useContactImport } from './useContactImport'; |
| | | import DialogCloseButton from './DialogCloseButton'; |
| | | import { usePapaParse } from './usePapaParse'; |
| | | |
| | | import { MouseEvent, useEffect, useState } from 'react'; |
| | | import * as sampleCsv from './contacts_export.csv?raw'; |
| | | |
| | | const SAMPLE_URL = `data:text/csv;name=crm_contacts_sample.csv;charset=utf-8,${encodeURIComponent(sampleCsv.default)}`; |
| | | |
| | | |
| | | export function ImportModal({ open, onClose }) { |
| | | export function ImportModal({ open, onClose, sampleCsv, useCodeImport }) { |
| | | const refresh = useRefresh(); |
| | | const { processBatch } = useContactImport(); |
| | | const { importer, parseCsv, reset } = usePapaParse<ContactImportSchema>({ |
| | | |
| | | const SAMPLE_URL = `data:text/csv;name=crm_contacts_sample.csv;charset=utf-8,${encodeURIComponent(sampleCsv.default)}`; |
| | | |
| | | const { processBatch } = useCodeImport(); |
| | | const { importer, parseCsv, reset } = usePapaParse({ |
| | | batchSize: 10, |
| | | processBatch, |
| | | }); |