diff --git a/src/pages/resources/[id]/index.tsx b/src/pages/resources/[id]/index.tsx index d3129e0..837dea4 100644 --- a/src/pages/resources/[id]/index.tsx +++ b/src/pages/resources/[id]/index.tsx @@ -2,13 +2,14 @@ import { GlobeAltIcon, DocumentIcon } from "@heroicons/react/24/solid"; import { PencilSquareIcon } from "@heroicons/react/20/solid"; import { api } from "~/utils/api"; import { ResourceDescription, ResourceInfo } from "~/components/ResourceTable"; -import { type PlatformLink } from "@prisma/client"; +import { type AuditoryResource, type PlatformLink } from "@prisma/client"; import Image from "next/image"; import Link from "next/link"; import { AdminBarLayout } from "~/components/admin/ControlBar"; import { AdminActionLink } from "~/components/admin/common"; import { useRouter } from "next/router"; import { HeaderFooterLayout } from "~/layouts/HeaderFooterLayout"; +import { QueryWaitWrapper } from "~/components/LoadingWrapper"; export const PlatformLinkButton = ({ platformLink, @@ -83,35 +84,27 @@ const ResourceViewPage = () => { const resourceQuery = api.auditoryResource.byId.useQuery({ id }); - const ConditionalView = () => { - if (!resourceQuery.data) { - return <>; - } - + const ConditionalView = (data: AuditoryResource) => { return (

Links

- +
- +
- Ages {resourceQuery.data.ages.min} - {resourceQuery.data.ages.max >= 100 - ? "+" - : `-${resourceQuery.data.ages.max}`} + Ages {data.ages.min} + {data.ages.max >= 100 ? "+" : `-${data.ages.max}`}
@@ -131,7 +124,7 @@ const ResourceViewPage = () => { } >
- +