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

Notes to import:

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

Import finished.

Go back to notes list or choose other notes to import.

} )}
) } export default Import