diff --git a/src/routes/documents.pleading.new.tsx b/src/routes/documents.pleading.new.tsx index b35cfa2..42998ac 100644 --- a/src/routes/documents.pleading.new.tsx +++ b/src/routes/documents.pleading.new.tsx @@ -308,6 +308,103 @@ function PleadingNewPage() { } /> + {/* Client / case linkage + variable picker */} + + +
+
+ +

+ Pick a client and/or case to expose variables (including custom fields). Insert tokens like{" "} + {`{{client.name}}`} anywhere in the body, caption, footnotes, or footer — they’ll be substituted on download & save. +

+
+
+ +
+
+ + +
+
+ + +
+
+ + {chips.length > 0 ? ( +
+
+ + setChipFilter(e.target.value)} + placeholder="Filter…" + className="h-8 max-w-[220px]" + /> +
+
+ {filteredChips.length === 0 ? ( + No matching variables. + ) : ( + filteredChips.map((c) => ( + + )) + )} +
+

+ Click a chip to copy its token, then paste it where you want the value to appear. +

+
+ ) : ( +
+ Select a client or case to see available variables. +
+ )} +
+
+ {/* Top row: settings + caption preview */}