"use client"; import React from "react"; import { addToast, Button, CircularProgress, Link } from "@heroui/react"; import { SendCallbackToServer } from "../lib/sendCallbackToServer"; import { useParams } from "next/navigation"; import { useRunOnce } from "@/shared/hooks/useRunOnce"; import { routes } from "@/shared/config/routes"; const LoadingProcess = () => { // Access the URL parameters const params = useParams(); // Forward the callback response to the backend server useRunOnce("forwardCallbackResponseToBackend", async () => { try { const response = await SendCallbackToServer( window.location.search, params.provider as string ); if (response.success) { window.close(); } else { addToast({ title: "😬 Oops, there's a problem!", description: response.text.message, color: "danger", timeout: 0, endContent: ( ), }); } } catch (error) { console.log(error); addToast({ title: "😵‍💫 Oops, lost connection!", description: "Check your internet and try again", color: "danger", timeout: 0, endContent: ( ), }); } }); return (

Please wait...

Your request is being processed

); }; export default LoadingProcess;