WIP(represtation step)

This commit is contained in:
Nathnael
2026-08-11 13:13:11 +00:00
parent d6e349f329
commit 637a766118

View File

@@ -23,7 +23,6 @@ import type {
} from "@/services/verifayda.service"; } from "@/services/verifayda.service";
import type { FormData } from "../schema"; import type { FormData } from "../schema";
import SourcedField from "../SourcedField";
/** How a foreign company chose to prove the person: Fayda, or a passport. */ /** How a foreign company chose to prove the person: Fayda, or a passport. */
export type IdentityMethod = "fayda" | "passport"; export type IdentityMethod = "fayda" | "passport";
@@ -251,55 +250,46 @@ export default function RepresentationStep({
)} )}
{/* -------------------------------------------------------------- */} {/* -------------------------------------------------------------- */}
{/* The representative's own details — only once the person exists, */} {/* The representative's own details — only once the person exists, */}
{/* and only the parts the verification did not already carry. What */} {/* and only the parts the verification did not carry. What Fayda */}
{/* Fayda supplied is shown on the panel above and never repeated. */} {/* supplied is on the card above; echoing it back here as read-only */}
{/* rows was the same data twice with nothing to do about either. */}
{/* -------------------------------------------------------------- */} {/* -------------------------------------------------------------- */}
{declared === "yes" && established && ( {declared === "yes" && established && (
<> <>
<SourcedField {!locked.name && (
label="Representative's Name"
value={identity.poa.name}
source="Fayda"
locked={locked.name}
>
<TextInput <TextInput
label="Representative's Name" label="Representative's Name"
placeholder="Abebe Bikila" placeholder="Abebe Bikila"
error={errors.poaName?.message} error={errors.poaName?.message}
{...register("poaName")} {...register("poaName")}
/> />
</SourcedField> )}
<SimpleGrid cols={{ base: 1, sm: 2 }} spacing="md"> {(!locked.email || !locked.phone) && (
<SourcedField <SimpleGrid
label="Representative's Email" cols={{ base: 1, sm: !locked.email && !locked.phone ? 2 : 1 }}
value={identity.poa.email} spacing="md"
source="Fayda"
locked={locked.email}
> >
<TextInput {!locked.email && (
label="Representative's Email" <TextInput
type="email" label="Representative's Email"
placeholder="representative@company.com" type="email"
error={errors.poaEmail?.message} placeholder="representative@company.com"
{...register("poaEmail")} error={errors.poaEmail?.message}
/> {...register("poaEmail")}
</SourcedField> />
)}
<SourcedField {!locked.phone && (
label="Representative's Phone" <ControlledPhoneField
value={identity.poa.phone} control={control}
source="Fayda" name="poaPhone"
locked={locked.phone} label="Representative's Phone"
> />
<ControlledPhoneField )}
control={control} </SimpleGrid>
name="poaPhone" )}
label="Representative's Phone"
/>
</SourcedField>
</SimpleGrid>
{!locked.address && ( {!locked.address && (
<TextInput <TextInput