import { TextField, Button, Box } from '@mui/material'; import { useState } from 'react'; function DocumentInput() { const [url, setUrl] = useState(''); const handleSubmit = async () => { try { const response = await fetch('/api/crawl/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ url }), }); if (!response.ok) throw new Error('Network response was not ok'); setUrl(''); } catch (error) { console.error('Error:', error); } }; return ( setUrl(e.target.value)} /> ); } export default DocumentInput;