From 7f9b7d067ff383b8236c2c4eb63eb19fd0b273a1 Mon Sep 17 00:00:00 2001 From: Shyam prakash Date: Wed, 1 Nov 2023 20:41:42 +0530 Subject: [PATCH] Added Loading component while the assets are being fetched. --- src/Components/Assets/AssetsList.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index 593afdb137c..8c19928fbee 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -65,7 +65,7 @@ const AssetsList = () => { status: qParams.status || "", }; - useQuery(routes.listAssets, { + const { loading } = useQuery(routes.listAssets, { query: params, onResponse: ({ res, data }) => { if (res?.status === 200 && data) { @@ -176,7 +176,13 @@ const AssetsList = () => { ); let manageAssets = null; - if (assetsExist) { + if (loading) { + manageAssets = ( +
+ +
+ ); + } else if (assetsExist) { manageAssets = (
{assets.map((asset: AssetData) => ( @@ -309,7 +315,7 @@ const AssetsList = () => {