feat: images upload
This commit is contained in:
@@ -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 (
|
||||
<Alert variant="warning">
|
||||
<TriangleAlertIcon />
|
||||
<AlertTitle>Identity document unavailable</AlertTitle>
|
||||
<AlertDescription>
|
||||
Your citizenship record exists, but no identity document was found. Contact the competent authority.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
if (!citizenship) {
|
||||
return (
|
||||
<Alert variant="warning">
|
||||
<TriangleAlertIcon />
|
||||
<AlertTitle>Citizenship record unavailable</AlertTitle>
|
||||
<AlertDescription>
|
||||
We couldn't verify your active citizenship record. Contact the competent authority.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-8">
|
||||
<IdentityCard data={identityDocument} />
|
||||
<div className="flex flex-col gap-2">
|
||||
<RenunciationDialog citizenship={citizenship} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user