import { useRef, useState } from 'react' import { uploadSeed, type SeedReport } from '../api/client' export default function SeedUpload({ onUploaded }: { onUploaded: () => void }) { const inputRef = useRef(null) const [report, setReport] = useState(null) const [error, setError] = useState(null) async function handle(file: File) { setError(null) try { setReport(await uploadSeed(file)) onUploaded() } catch (e) { setError((e as Error).message) } } return (
{ const file = e.target.files?.[0] if (file) void handle(file) e.target.value = '' }} /> {report && (

신규 {report.created} / 갱신 {report.updated} / 전체 {report.total}

)} {error &&

{error}

}
) }