import { useState } from 'react'; import { useZino } from '../api/provider'; import { ORG_ID } from '../api/config'; import { Button, ErrorNote, Input, Label } from '../components/core'; import { HdfcWordmark } from '../components/HdfcMark'; import { ThemeToggle } from '../components/ThemeToggle'; /** * Sign in. * * The org is fixed — this build serves one tenant — so it is not a field the * user has to know. It still goes over the wire as a STRING: the gateway * rejects a number with "cannot unmarshal number into Go struct field * LoginRequest.org_id", which is a confusing failure to hit from a login form. */ export function Login() { const { login } = useZino(); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [busy, setBusy] = useState(false); const [err, setErr] = useState(null); async function submit() { if (!email || !password) { setErr('Enter your email and password'); return; } setBusy(true); setErr(null); try { await login(email, password, ORG_ID); } catch (e) { setErr((e as { message?: string })?.message ?? 'Could not sign in'); } finally { setBusy(false); } } return (
{ e.preventDefault(); void submit(); }} className="lift w-full max-w-sm rounded-lg border border-line bg-panel p-6" >

Sign in

MSME and personal loan origination.

{err && {err}}
); }