Spaces:
Sleeping
Sleeping
File size: 1,044 Bytes
9a9d08c 5e0990b 9a9d08c 743fc77 9a9d08c 743fc77 5e0990b 743fc77 9a9d08c 743fc77 9a9d08c 5e0990b 9a9d08c 743fc77 9a9d08c 73d7d71 5e0990b 73d7d71 5e0990b 73d7d71 5e0990b 73d7d71 9a9d08c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import { useEffect, useState } from "react";
import { fetchResult } from "@/VerificationScene.tsx";
export default function ResultContainer({
sendImageToServer,
idCardPicture,
profileImage,
}: {
sendImageToServer: (
pic: string,
pic2: string,
setLoading: (n: fetchResult) => void,
) => void;
idCardPicture: string;
profileImage: string;
}) {
const [loading, setLoading] = useState<fetchResult>("Fetching");
useEffect(() => {
sendImageToServer(idCardPicture ?? "", profileImage ?? "", setLoading);
}, []);
return (
<div className="flex w-full h-full items-center justify-center">
{loading === "Fetching" ? (
<h1 className="text-2xl font-bold text-orange-600">Fetching....</h1>
) : loading === "Valid" ? (
<h1 className="text-2xl font-bold text-green-800">Valid</h1>
) : loading === "Not Valid" ? (
<h1 className="text-2xl font-bold text-green-800">Not Valid</h1>
) : (
<h1 className="text-2xl text-red-700">Error</h1>
)}
</div>
);
}
|