This commit is contained in:
Ivan Rezchikov
2026-07-11 21:20:57 +03:00
parent e192717466
commit 18161f4604
57 changed files with 1211 additions and 615 deletions
@@ -7,6 +7,7 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
import { Separator } from "@/components/ui/separator";
import { Spinner } from "@/components/ui/spinner";
import { Textarea } from "@/components/ui/textarea";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { approveApplication, rejectApplication } from "@/lib/citizenship/actions";
import { CitizenshipApplicationWithWarning } from "@/lib/citizenship/types";
import { formatDate } from "@/lib/utils";
@@ -22,7 +23,7 @@ export default function ApplicationCard({ application, onClose }: { application:
if (!application?.id) {
return (
<div className="w-sm flex items-center justify-center ring-1 ring-foreground/10 rounded-xl text-muted-foreground px-4">
<div className="max-w-sm w-full flex items-center justify-center ring-1 ring-foreground/10 rounded-xl text-muted-foreground px-4 py-1">
Click on a row to see the application
</div>
)
@@ -64,18 +65,14 @@ export default function ApplicationCard({ application, onClose }: { application:
<CardDescription>{application.applicationType === "PREVIOUS_CITIZENSHIP" ? "Previous citizenship application" : "Naturalization application"}</CardDescription>
</CardHeader>
<CardContent className="max-w-sm">
<div className="flex flex-row gap-2 mb-2">
<img
src={application.profileUrl}
alt="Profile"
className={"w-18 h-24 rounded-md object-cover ring-1 ring-foreground/10 shrink-0"}
/>
<img
src={application.signatureUrl}
alt="Profile"
className={"w-36 h-18 rounded-md object-cover ring-1 ring-foreground/10 shrink-0"}
/>
<div className="flex flex-row gap-3 mb-4">
<div className="w-20 aspect-4/5 rounded-md overflow-hidden ring-1 ring-foreground/10 shrink-0">
<img src={application.profileUrl} alt="Profile photo" className="w-full h-full object-cover" />
</div>
<div className="w-40 px-2 aspect-5/2 rounded-md overflow-hidden ring-1 ring-foreground/10 shrink-0 bg-white">
<img src={application.signatureUrl} alt="Signature" className="w-full h-full object-contain" />
</div>
</div>
<div className="flex flex-col gap-1">
<h4 className="mb-1">Personal information</h4>
{ application.nameMismatch && (
@@ -110,7 +107,14 @@ export default function ApplicationCard({ application, onClose }: { application:
</div>
<div className="flex flex-col gap-0.5">
<p className="text-muted-foreground">Address</p>
<p className="truncate">{application.address}</p>
<Tooltip>
<TooltipTrigger>
<p className="text-start truncate">{application.address}</p>
</TooltipTrigger>
<TooltipContent>
<p>{application.address}</p>
</TooltipContent>
</Tooltip>
</div>
<div className="flex flex-row gap-4 items-center">
<p className="text-muted-foreground">Height</p>
@@ -169,7 +173,7 @@ export default function ApplicationCard({ application, onClose }: { application:
/>
<DialogFooter>
<Button variant="outline" onClick={() => setRejectOpen(false)}>Cancel</Button>
<Button variant="destructive" onClick={handleReject} disabled={!reason.trim() || isloading}>
<Button onClick={handleReject} disabled={!reason.trim() || isloading}>
{isloading && <Spinner />}Confirm rejection
</Button>
</DialogFooter>
+1 -1
View File
@@ -12,7 +12,7 @@ export default function ReviewPageClient({ applications }: { applications: Citiz
return (
<>
<div className="flex flex-row gap-16">
<div className="flex flex-col-reverse md:flex-row gap-8 md:gap-16">
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-6">
<h2>Review citizenship applications</h2>
+4 -10
View File
@@ -1,5 +1,3 @@
import Header from "@/components/header";
import Footer from "@/components/footer";
import ReviewPageClient from "./client";
import { getCurrentUser } from "@/lib/user";
import { redirect } from "next/navigation";
@@ -29,13 +27,9 @@ export default async function ReviewPage() {
);
return (
<>
<Header />
<div className="flex flex-row py-16 gap-8">
<AccountMenu />
<ReviewPageClient applications={applicationsWithWarning} />
</div>
<Footer />
</>
<div className="flex flex-col md:flex-row p-4 md:p-16 gap-8 md:gap-16 mb-4 md:mb-0">
<AccountMenu />
<ReviewPageClient applications={applicationsWithWarning} />
</div>
);
}