Start supporting edit forms for any document type.

This commit is contained in:
2025-06-13 11:14:58 -07:00
parent 38eee14253
commit 6845bd06bf
4 changed files with 63 additions and 26 deletions

View File

@@ -3,7 +3,7 @@ import { pb } from "@/lib/pocketbase";
import type { Document, RelationshipType } from "@/lib/types";
import { useState } from "react";
import { Loader } from "./Loader";
import { DocumentForm } from "./documents/DocumentForm";
import { NewRelatedDocumentForm } from "./documents/NewRelatedDocumentForm";
import { DocumentRow } from "./documents/DocumentRow";
interface RelationshipListProps {
@@ -68,7 +68,7 @@ export function RelationshipList({
error={error}
renderRow={(document) => <DocumentRow document={document} />}
newItemForm={(onSubmit) => (
<DocumentForm
<NewRelatedDocumentForm
campaignId={root.campaign}
relationshipType={relationshipType}
onCreate={async (doc: Document) => {