Makes some document previews

This commit is contained in:
2025-07-26 13:26:31 -07:00
parent 4a109d152c
commit c7083a9b56
8 changed files with 135 additions and 10 deletions

View File

@@ -1,7 +1,9 @@
import { DocumentPreview } from "@/components/documents/DocumentPreview";
import { DocumentRow } from "@/components/documents/DocumentRow";
import { SessionRow } from "@/components/documents/session/SessionRow";
import { Tab, TabbedLayout } from "@/components/layout/TabbedLayout";
import { Loader } from "@/components/Loader";
import { DocumentLoader } from "@/context/document/DocumentLoader";
import { useDocument } from "@/context/document/hooks";
import { pb } from "@/lib/pocketbase";
import type { Campaign, DocumentId, Relationship, Session } from "@/lib/types";
@@ -166,11 +168,14 @@ function Flyout({ docId }: { docId: DocumentId }) {
const { docResult } = useDocument(docId);
if (docResult?.type !== "ready") {
return <Loader />;
return (
<DocumentLoader documentId={docId}>
<Loader />
</DocumentLoader>
);
}
const doc = docResult.value.doc;
// TODO: Document preview
return <DocumentRow document={doc} root={doc} />;
return <DocumentPreview doc={doc} />;
}