diff --git a/src/app/document/view/[slug]/DocumentViewer.tsx b/src/app/document/view/[slug]/DocumentViewer.tsx index 6bc1c35..e0a7a96 100644 --- a/src/app/document/view/[slug]/DocumentViewer.tsx +++ b/src/app/document/view/[slug]/DocumentViewer.tsx @@ -1,4 +1,4 @@ -import { DocumentType } from '@/app/db/data' +import { DocumentType, documents } from '@/app/db/data' import { Zilla_Slab } from 'next/font/google' import { epoch2datestring } from '@/app/utils/epoch2datestring' import { @@ -10,21 +10,11 @@ import { } from '@/app/components/DataDisplay' import { ItemBadge, Status } from '@/app/components/Badges' import Link from 'next/link' -import { useSuspenseQuery } from '@tanstack/react-query' -import { loadDocument } from '@/app/db/loaders' const zillaSlab = Zilla_Slab({ subsets: ['latin'], weight: ['500'] }) export default function DocumentViewer({ slug }: Readonly<{ slug: string }>) { - const { data, error } = useSuspenseQuery({ - queryKey: [slug], - queryFn: () => { - const data = loadDocument(slug) - return data - }, - }) - - const { manifest, abstract, file, citation } = data + const { manifest, abstract, file, citation } = documents[slug] const { title, authors, @@ -38,8 +28,6 @@ export default function DocumentViewer({ slug }: Readonly<{ slug: string }>) { status, } = manifest - if (error) throw error - return (