import styles from '../styles/Notes.module.scss' import React, { useState } from 'react' import useSettings from 'hooks/useSettings' import useNotes from '../hooks/useNotes' import { state, color, handleImport, handleChange } from '../helpers/import' const Import = ({ setAction }) => { const { t } = useSettings() const [files, setFiles] = useState() const [done, setDone] = useState([]) const { mutateNotes } = useNotes() return (
{ setAction('') }}>{t('back')}
handleImport(e, files, mutateNotes, setDone)}> {t('notes_import')}
{files && ( <>

{t('notes_to_import')}

    {[...files].map((f, i) =>
  • {f.name} {state(done[i])}
  • )}
{ done.length === 0 ? :

{t('import_finished')}

{t('notes_import_go_back')}

} )}
) } export default Import