30 lines
931 B
TypeScript
30 lines
931 B
TypeScript
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 (
|
|
<>
|
|
<Header />
|
|
<div className="flex flex-row py-16 gap-8">
|
|
<AccountMenu />
|
|
<ReviewPageClient applications={applicationsWithWarning} />
|
|
</div>
|
|
<Footer />
|
|
</>
|
|
);
|
|
} |