frontend/pages/upload.tsx
2022-08-27 01:37:17 +03:00

44 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { NextPage } from 'next'
import Head from 'next/head'
import { ErrorViewer } from '../Components/ErrorViewer'
import { FileUploader } from '../Components/FileUploader'
import { Header } from '../Components/header'
import styles from '../styles/Home.module.css'
import 'antd/dist/antd.css';
import { ItemSelect, SelectItemIE } from '../Components/ItemSelect'
import { useState } from 'react'
import { useRouter } from 'next/router'
const Upload: NextPage = () => {
const [files, setFiles] = useState(new Array())
let router = useRouter()
const onNext = () =>{
localStorage.setItem("files", JSON.stringify(files))
router.push("/")
}
return (
<div className={styles.container}>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={styles.main}>
<Header></Header>
<div className={styles.upload}>
<FileUploader onResponse={(file)=>setFiles([...files, file])}></FileUploader>
<div className={styles.btn} onClick={()=>onNext()}>Далее</div>
</div>
</main>
</div>
)
}
export default Upload