From 7cd6d60ba9efeff61fcb9016a7fed725813fac18 Mon Sep 17 00:00:00 2001 From: spaenleh Date: Fri, 30 Jun 2023 10:39:18 +0200 Subject: [PATCH] fix: interface and url --- src/App.tsx | 4 ++-- src/components/UseCase.tsx | 32 ++++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c577f18..b3b6b20 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -108,8 +108,8 @@ const App = () => { setExplanationData(convertToString(d))} /> diff --git a/src/components/UseCase.tsx b/src/components/UseCase.tsx index 72c564b..56402d3 100644 --- a/src/components/UseCase.tsx +++ b/src/components/UseCase.tsx @@ -1,3 +1,4 @@ +import { useState } from "react"; import { ExplanationData } from "../WordCloud"; import { transformGPipelineData } from "./utils/transformations"; @@ -55,7 +56,9 @@ const UseCase = ({ categoriesFile, onSubmit, }: Props) => { + const [loadingData, setLoadingData] = useState(false); const onClick = async () => { + setLoadingData(true); // load the data from the files const nodesFileData = await fetch(nodesFile); const nodes = await nodesFileData.json(); @@ -64,15 +67,36 @@ const UseCase = ({ console.log(nodes, categories); const xData = transformGPipelineData(nodes, categories); onSubmit(xData); + setLoadingData(false); }; return (
-
{label}
-
{description}
- +
{description}
); };