import { useState } from 'react' import { login } from '../api/client' export default function LoginPage({ onSuccess }: { onSuccess: () => void }) { const [username, setUsername] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState(null) async function submit(e: React.FormEvent) { e.preventDefault() setError(null) try { await login(username, password) onSuccess() } catch (err) { setError((err as Error).message) } } return (

ITN-HUB

사업관리시스템

setUsername(e.target.value)} /> setPassword(e.target.value)} /> {error &&

{error}

}
) }