"use client"; import { useActionState, useState } from "react"; import { Button } from "@/components/ui/button"; import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSet, } from "@/components/ui/field"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Alert, AlertDescription, AlertTitle, } from "@/components/ui/alert"; import { InfoIcon } from "lucide-react"; import { submitCitizenshipApplication, type ApplicationState } from "@/lib/citizenship/actions"; import { EYE_COLORS } from "@/lib/citizenship/types"; import Link from "next/link"; import { Spinner } from "@/components/ui/spinner"; type Props = { firstName: string; secondName: string; sex: string; birthDate: Date | null; }; const initialState: ApplicationState = { success: false, errors: [] }; function formatDate(d: Date | null): string { if (!d) return ""; return d.toISOString().split("T")[0]; } type AppType = "PREVIOUS_CITIZENSHIP" | "BORN_IN_TERRITORY" | "NATURALIZATION"; export function CitizenshipApplicationForm({ firstName, secondName, sex, birthDate }: Props) { const [appType, setAppType] = useState(""); const [state, formAction, isPending] = useActionState(submitCitizenshipApplication, initialState); return (
Personal information Important notice Personal data is sourced from your account profile. Please ensure that all information is accurate. If corrections are required, update your details in Kotosoft ID and synchronise your account. Surname Given names
Sex Date of birth
Eligibility basis Select the basis on which you are applying for citizenship. setAppType(v as AppType)} required > Previous citizenship holder I held citizenship of the Duspean Republic or the Country of Reality on 31 March 2026. Born in territory I was born in the European Federation, the former Duspean Republic, or the Country of Reality, and do not hold citizenship. Naturalisation I am a foreign national seeking naturalisation.
{appType === "PREVIOUS_CITIZENSHIP" && (
Previous citizenship details Country Region of issuance The region or authority that issued your previous citizenship. The list of regions is here.
)} {appType === "BORN_IN_TERRITORY" && (
Birth details Region of birth The municipality, region, and country where you were born. The list of regions is here.
)} {appType === "NATURALIZATION" && (
Naturalisation statement Why do you wish to become a citizen of the European Federation?