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 { host } from '../api/consts' import { PulseLoader } from 'react-spinners' import axios from 'axios' import { useRouter } from 'next/router' const View: NextPage = () => { let router = useRouter() let uuid = router.query.id as string const [data,setData] = useState("") let i = 1; let cards = new Array() const getData = () =>{ if (data == ""){ axios.get(host+"/api/site/docx/" + uuid).then(res => { setData(res.data) }) } } setTimeout(getData, 2000); if (data != ""){ for(var name in data as any) { cards.push( ) i++ } } return (
Вьюха
router.back()}>
{localStorage.getItem(uuid)?.slice(48,localStorage.getItem(uuid)?.length)}
{data == ""? :cards}
) } export default View