import { useState } from "react"; import { RegisterForm, type RegistrationDraft } from "../../../features/register-account"; import { ResendVerificationForm } from "../../../features/resend-email-verification"; import { Button, Page, Section, TextLink } from "../../../shared/ui"; import { paths } from "../../../shared/config"; import { clearRegistrationContext, readRegistrationContext, writeRegistrationContext, type RegistrationContext, } from "../model/registration-context"; function scenarioLabel(scenario: RegistrationDraft["scenario"]): string { return scenario === "employer" ? "работодатель" : "кандидат"; } export function RegisterPage() { const [context, setContext] = useState(readRegistrationContext); function saveDraft(draft: RegistrationDraft) { const next = { ...draft, accepted: false }; setContext(next); writeRegistrationContext(next); } function markAccepted(draft: RegistrationDraft) { const next = { ...draft, accepted: true }; setContext(next); writeRegistrationContext(next); } function startAgain() { clearRegistrationContext(); setContext({ email: "", scenario: "", accepted: false }); } return ( {context.accepted ? (

Если для этого адреса требуется подтверждение, письмо будет отправлено. Выбранный сценарий: {scenarioLabel(context.scenario)}.

Перейти ко входу
) : (
)}
); }