From 54701726cd8b456fe4270136bf3c5e29251f6a7a Mon Sep 17 00:00:00 2001 From: Brandon Egger Date: Tue, 6 Jun 2023 22:05:27 -0500 Subject: [PATCH] improve table loading --- src/pages/resources/[id]/index.tsx | 66 ++++++++++++++++-------------- src/pages/resources/index.tsx | 31 ++++++++------ 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/src/pages/resources/[id]/index.tsx b/src/pages/resources/[id]/index.tsx index 56bf387..43fc1e2 100644 --- a/src/pages/resources/[id]/index.tsx +++ b/src/pages/resources/[id]/index.tsx @@ -130,9 +130,41 @@ const ResourceViewPage = ( const resourceQuery = api.auditoryResource.byId.useQuery({ id }); const router = useRouter(); - if (!resourceQuery.data) { - return <>; - } + const ConditionalView = () => { + if (!resourceQuery.data) { + return <>; + } + + return ( +
+
+
+

Links

+ +
+
+
+ +
+ +
+
+ + Ages {resourceQuery.data.ages.min} + {resourceQuery.data.ages.max >= 100 + ? "+" + : `-${resourceQuery.data.ages.max}`} + +
+
+
+ ); + }; return ( <> @@ -148,33 +180,7 @@ const ResourceViewPage = ( } >
-
-
-
-

Links

- -
-
-
- -
- -
-
- - Ages {resourceQuery.data.ages.min} - {resourceQuery.data.ages.max >= 100 - ? "+" - : `-${resourceQuery.data.ages.max}`} - -
-
-
+