From 06590feea193e44cbacf6f397558fa10578d96a7 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Thu, 24 Jul 2025 10:24:13 +0000 Subject: [PATCH] Update app/src/components/templates/LoadingPage.tsx --- app/src/components/templates/LoadingPage.tsx | 136 +++++++++---------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/app/src/components/templates/LoadingPage.tsx b/app/src/components/templates/LoadingPage.tsx index 6855808..dec7e1b 100644 --- a/app/src/components/templates/LoadingPage.tsx +++ b/app/src/components/templates/LoadingPage.tsx @@ -1,68 +1,68 @@ -import React, { useEffect } from "react"; -import RenderOverlay from "./Overlay"; -import { LogoIconLarge } from "../icons/Logo"; -import { useParams } from "react-router-dom"; -import { useProjectName } from "../../store/builder/store"; -import { getAllProjects } from "../../services/dashboard/getAllProjects"; -import { useComparisonProduct } from "../../store/simulation/useSimulationStore"; -import { getUserData } from "../../functions/getUserData"; - -interface LoadingPageProps { - progress: number; // Expect progress as a percentage (0-100) -} - -const LoadingPage: React.FC = ({ progress }) => { - const { projectName, setProjectName } = useProjectName(); - const { projectId } = useParams(); - const { comparisonProduct } = useComparisonProduct(); - const { userId, organization, email } = getUserData(); - - const validatedProgress = Math.min(100, Math.max(0, progress)); - const generateThumbnail = async () => { - try { - if (!email || !userId) { - console.error("User data not found in localStorage"); - return; - } - - const projects = await getAllProjects(userId, organization); - const filterProject = projects?.Projects.find( - (val: any) => val.projectUuid === projectId || val._id === projectId - ); - - setProjectName(filterProject.projectName); - } catch { } - }; - useEffect(() => { - generateThumbnail(); - }, []); - return ( - -
-
-
{projectName}
-
-
- -
-
Entering A New World of Dwinzo
-
-
-
{validatedProgress}%
-
-
-
-
-
-
-
- ); -}; - -export default LoadingPage; +import React, { useEffect } from "react"; +import RenderOverlay from "./Overlay"; +import { LogoIconLarge } from "../icons/Logo"; +import { useParams } from "react-router-dom"; +import { useProjectName } from "../../store/builder/store"; +import { getAllProjects } from "../../services/dashboard/getAllProjects"; +import { useComparisonProduct } from "../../store/simulation/useSimulationStore"; +import { getUserData } from "../../functions/getUserData"; + +interface LoadingPageProps { + progress: number; // Expect progress as a percentage (0-100) +} + +const LoadingPage: React.FC = ({ progress }) => { + const { projectName, setProjectName } = useProjectName(); + const { projectId } = useParams(); + const { comparisonProduct } = useComparisonProduct(); + const { userId, organization, email } = getUserData(); + + const validatedProgress = Math.min(100, Math.max(0, progress)); + const generateThumbnail = async () => { + try { + if (!email || !userId) { + console.error("User data not found in localStorage"); + return; + } + + const projects = await getAllProjects(userId, organization); + const filterProject = projects?.Projects.find( + (val: any) => val.projectUuid === projectId || val._id === projectId + ); + + setProjectName(filterProject.projectName); + } catch { } + }; + useEffect(() => { + generateThumbnail(); + }, []); + return ( + +
+
+
{projectName}
+
+
+ +
+
Entering A New World with your Aalai
+
+
+
{validatedProgress}%
+
+
+
+
+
+
+
+ ); +}; + +export default LoadingPage;