import Header from "@/components/header";
import Footer from "@/components/footer";
import ReviewPageClient from "./client";
import { getCurrentUser } from "@/lib/user";
import { redirect } from "next/navigation";
import { AccountMenu } from "../../account-menu";
import { getPendingApplications } from "@/lib/citizenship/repository";
export default async function ReviewPage() {
const user = await getCurrentUser();
if (!user?.isAdmin) redirect("/account/citizenship");
const applications = await getPendingApplications()
const applicationsWithWarning = applications.map((app) => ({
...app,
nameMismatch: app.givenNames !== app.user.firstName || app.surname !== app.user.secondName,
}))
return (
<>