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 (
+
+
+
+
+
+
+
+
+
+ Ages {resourceQuery.data.ages.min}
+ {resourceQuery.data.ages.max >= 100
+ ? "+"
+ : `-${resourceQuery.data.ages.max}`}
+
+
+
+
+ );
+ };
return (
<>
@@ -148,33 +180,7 @@ const ResourceViewPage = (
}
>
-
-
-
-
-
-
-
-
-
- Ages {resourceQuery.data.ages.min}
- {resourceQuery.data.ages.max >= 100
- ? "+"
- : `-${resourceQuery.data.ages.max}`}
-
-
-
-
+
diff --git a/src/pages/resources/index.tsx b/src/pages/resources/index.tsx
index 5f19b47..5922096 100644
--- a/src/pages/resources/index.tsx
+++ b/src/pages/resources/index.tsx
@@ -23,17 +23,30 @@ const Resources = () => {
skills: queryData.skills,
});
- if (!resourceQuery.data) {
- return <>>;
- }
-
- const totalPages = Math.ceil(resourceQuery.data.count / queryData.perPage);
const printQueryStr =
router.asPath.split("?").length === 2
? router.asPath.split("?").at(-1) ?? ""
: "";
const printLink = `${router.route}/print?${printQueryStr}`;
+ const ConditionalTable = () => {
+ if (!resourceQuery.data) {
+ return <>>;
+ }
+
+ const totalPages = Math.ceil(resourceQuery.data.count / queryData.perPage);
+
+ return (
+
+ );
+ };
+
return (
<>
@@ -67,13 +80,7 @@ const Resources = () => {
-
+
>