@@ -40,4 +47,4 @@ export default async function CitizenshipApplication() {
>
);
-}
+}
\ No newline at end of file
diff --git a/app/account/citizenship/has-citizenship.tsx b/app/account/citizenship/has-citizenship.tsx
new file mode 100644
index 0000000..3e9bd8b
--- /dev/null
+++ b/app/account/citizenship/has-citizenship.tsx
@@ -0,0 +1,44 @@
+import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
+import IdentityCard from "@/components/identity-card";
+import { getIdentityCardData } from "@/lib/id/repository";
+import { TriangleAlertIcon } from "lucide-react";
+import { RenunciationDialog } from "./renunciation-dialog";
+import { getActiveCitizenship } from "@/lib/citizenship/repository";
+
+export async function HasCitizenship({ userId }: { userId: string }) {
+ const identityDocument = await getIdentityCardData(userId);
+ const citizenship = await getActiveCitizenship(userId);
+
+ if (!identityDocument) {
+ return (
+
+
+ Identity document unavailable
+
+ Your citizenship record exists, but no identity document was found. Contact the competent authority.
+
+
+ );
+ }
+
+ if (!citizenship) {
+ return (
+
+
+ Citizenship record unavailable
+
+ We couldn't verify your active citizenship record. Contact the competent authority.
+
+
+ );
+ }
+
+ return (
+
+
+
+
+
+
+ );
+}
diff --git a/app/account/citizenship/no-citizenship.tsx b/app/account/citizenship/no-citizenship.tsx
new file mode 100644
index 0000000..9a431af
--- /dev/null
+++ b/app/account/citizenship/no-citizenship.tsx
@@ -0,0 +1,90 @@
+import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
+import { Button } from "@/components/ui/button";
+import { InfoIcon } from "lucide-react";
+import Link from "next/link";
+import {
+ Accordion,
+ AccordionContent,
+ AccordionItem,
+ AccordionTrigger,
+} from "@/components/ui/accordion";
+import { ApplicationsDialog } from "./applications-dialog";
+import { getUserApplications } from "@/lib/citizenship/repository";
+
+export async function NoCitizenship({ userId }: { userId: string }) {
+ const applications = await getUserApplications(userId);
+
+ return (
+
+
+
+ You are not a citizen of the European Federation
+
+ You currently hold non-citizen status. Certain civic services and
+ identity documents are available only to citizens of the European Federation.
+
+
+
+
+
+
+
+
+
+
+
+
+ {applications.length > 0 && }
+
+
+
+
+
Who is eligible for citizenship?
+
+ Citizenship may be granted to persons born in the European
+ Federation, the former Duspean Republic, or the Country of Reality,
+ as well as to individuals who held citizenship of the Duspean
+ Republic or the Country of Reality on 31 March 2026.
+
+ Foreign nationals who demonstrate a commitment to the development,
+ prosperity, and values of the European Federation may also be
+ eligible for naturalisation under federal law.
+
+
+
+
What rights does citizenship provide?
+
+ Citizens enjoy all rights and protections guaranteed by the
+ Constitution and laws of the European Federation, including the
+ right to obtain federal identity documents, participate in federal
+ elections, and receive protection from federal authorities.
+
+
+
+
What documents are required?
+
+ Applicants may be asked to provide proof of
+ residence in the European Federation, evidence of eligibility, and any additional documents
+ required by the competent authority.
+
+
+
+
How long does the application process take?
+
+ Processing times vary depending on the complexity of the
+ application and the volume of requests currently under review.
+ Applicants can track the status of their application through their
+ account.
+
+
+
+
Is dual citizenship permitted?
+
+ The European Federation generally permits dual citizenship unless
+ otherwise restricted by federal law or international agreements.
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/app/account/citizenship/page.tsx b/app/account/citizenship/page.tsx
index 6f9caaf..bc01c4f 100644
--- a/app/account/citizenship/page.tsx
+++ b/app/account/citizenship/page.tsx
@@ -3,41 +3,18 @@ import Header from "@/components/header";
import { getCurrentUser } from "@/lib/user";
import { redirect } from "next/navigation";
import { AccountMenu } from "../account-menu";
-import { InfoIcon } from "lucide-react";
-import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import Link from "next/link";
-import {
- Accordion,
- AccordionContent,
- AccordionItem,
- AccordionTrigger,
-} from "@/components/ui/accordion";
-import { ApplicationsDialog } from "./applications-dialog";
-import { getPendingApplicationsCount, getUserApplications } from "@/lib/citizenship/repository";
-import { prisma } from "@/lib/prisma";
-import { CitizenshipApplication } from "@/lib/citizenship/types";
-import { getIdentityCardData, IdentityCardData } from "@/lib/id/repository";
-import IdCard from "@/components/id-card";
+import { getPendingApplicationsCount, getActiveCitizenship } from "@/lib/citizenship/repository";
+import { HasCitizenship } from "./has-citizenship";
+import { NoCitizenship } from "./no-citizenship";
export default async function Citizenship() {
const user = await getCurrentUser()
if (!user) redirect("/")
- const citizenship = await prisma.citizenship.findUnique({ where: { userId: user.id } })
-
- let applications: CitizenshipApplication[] = []
- let pendingCount = 0
- let identityDocument: IdentityCardData | null = null
-
- if (citizenship) {
- identityDocument = await getIdentityCardData(user.id)
- } else {
- applications = await getUserApplications(user.id)
- if (user.isAdmin) {
- pendingCount = await getPendingApplicationsCount()
- }
- }
+ const citizenship = await getActiveCitizenship(user.id)
+ const pendingCount = user.isAdmin ? await getPendingApplicationsCount() : 0
return (
<>
@@ -47,103 +24,18 @@ export default async function Citizenship() {
Citizenship
- {citizenship ? (
-
-
-
- ) : (
-
-
-
- You are not a citizen of the European Federation
-
- You currently hold non-citizen status. Certain civic services and
- identity documents are available only to citizens of the European Federation.
-
-
-
-
-
- Citizenship may be granted to persons born in the European
- Federation, the former Duspean Republic, or the Country of Reality,
- as well as to individuals who held citizenship of the Duspean
- Republic or the Country of Reality on 31 March 2026.
-
-
- Foreign nationals who demonstrate a commitment to the development,
- prosperity, and values of the European Federation may also be
- eligible for naturalisation under federal law.
-
-
-
-
-
What rights does citizenship provide?
-
-
- Citizens enjoy all rights and protections guaranteed by the
- Constitution and laws of the European Federation, including the
- right to obtain federal identity documents, participate in federal
- elections, and receive protection from federal authorities.
-
-
-
-
-
What documents are required?
-
-
- Applicants may be asked to provide proof of
- residence in the European Federation, evidence of eligibility, and any additional documents
- required by the competent authority.
-
-
-
-
-
How long does the application process take?
-
-
- Processing times vary depending on the complexity of the
- application and the volume of requests currently under review.
- Applicants can track the status of their application through their
- account.
-
-
-
-
-
Is dual citizenship permitted?
-
-
- The European Federation generally permits dual citizenship unless
- otherwise restricted by federal law or international agreements.
-
-
-
-
{ application.nameMismatch && (
@@ -59,6 +85,13 @@ export default function ApplicationCard({ application, onClose }: { application:
The name on this application differs from the applicant's Kotosoft ID. Verify before approving.
)}
+ { application.previousCitizenship && (
+
+
+ Previous citizenship holder
+ This person previously held citizenship of the European Federation. Please verify the reason for renunciation.
+
+ )}
Given names
{application.givenNames}
diff --git a/app/account/citizenship/review/client.tsx b/app/account/citizenship/review/client.tsx
index 1345d4b..812e2f8 100644
--- a/app/account/citizenship/review/client.tsx
+++ b/app/account/citizenship/review/client.tsx
@@ -1,13 +1,13 @@
"use client"
-import { CitizenshipApplication } from "@/lib/citizenship/types";
+import { CitizenshipApplicationWithWarning } from "@/lib/citizenship/types";
import { DataTable } from "./data-table";
import { columns } from "./columns";
import ApplicationCard from "./application-card";
import { useState } from "react";
-export default function ReviewPageClient({ applications }: { applications: CitizenshipApplication[] }) {
+export default function ReviewPageClient({ applications }: { applications: CitizenshipApplicationWithWarning[] }) {
const [selectedApplicationId, setSelectedApplicationId] = useState("");
return (
@@ -17,9 +17,16 @@ export default function ReviewPageClient({ applications }: { applications: Citiz