import { useEffect, useState } from "react"; import { IdentificationCard, ArrowRight, WarningCircle } from "@phosphor-icons/react"; import { api, type RunSummary, ApiError } from "../lib/api"; import { ErrorNote, Note, Spinner } from "./common"; interface Parsed { raw: string; valid: boolean; error: string; is_listed: boolean | null; industry_code: string; nic_division_name: string; state: string; state_code: string; year: number | null; age_years: number | null; ownership_code: string; ownership: string; is_public_company: boolean | null; registration_number: string; listing: string; } /** Intake for a pre-IPO issuer: no exchange history, so the CIN is the only * record that exists until documents are supplied. */ export function CinIntake({ onStarted }: { onStarted: (run: RunSummary) => void }) { const [cin, setCin] = useState(""); const [name, setName] = useState(""); const [parsed, setParsed] = useState(null); const [error, setError] = useState(null); const [starting, setStarting] = useState(false); useEffect(() => { const v = cin.trim().toUpperCase(); if (v.length < 21) { setParsed(null); return; } const t = setTimeout(() => { api.inspectCin(v).then(setParsed).catch(() => setParsed(null)); }, 150); return () => clearTimeout(t); }, [cin]); const start = async () => { setStarting(true); setError(null); try { onStarted(await api.createRunFromCin(cin.trim().toUpperCase(), name)); } catch (e) { setError(e instanceof ApiError ? e.message : String(e)); setStarting(false); } }; const seg = (label: string, value: string, chars: string) => (
{label} {value} {chars}
); return (

Pre-IPO issuer

An unlisted company has no exchange filing history, so it cannot be found by search. Its Corporate Identity Number is a real registry identifier and settles several eligibility questions on its own. Financial disclosures stay absent until documents are supplied, and the draft will say so rather than fill them in.
setCin(e.target.value.toUpperCase())} />
21 characters, as issued by the Ministry of Corporate Affairs.
setName(e.target.value)} />
Recorded as unverified: a name typed by hand is not corroborated by any register.
{cin.trim().length >= 21 && parsed && !parsed.valid && ( )} {error &&
}
); }