import { useState } from 'react' import DropZone from '../components/DropZone' import { uploadDocument } from '../api/client' interface Props { onTaskCreated: (taskId: string) => void } export default function Home({ onTaskCreated }: Props) { const [file, setFile] = useState(null) const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const handleSubmit = async () => { if (!file) return setLoading(true) setError(null) try { const res = await uploadDocument(file) onTaskCreated(res.task_id) } catch (e: unknown) { const msg = (e as { response?: { data?: { detail?: string } } })?.response?.data?.detail ?? 'Ошибка загрузки' setError(msg) } finally { setLoading(false) } } return (

Антиплагиат

Загрузите документ для проверки на заимствования

{error && (

{error}

)}
) }