Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 19:14:42 +00:00
co-authored by renee-png
parent cd2cd06ce8
commit 34bb098ef1
4 changed files with 25 additions and 10 deletions
+7 -2
View File
@@ -22,6 +22,7 @@ import { useAuth } from "@/lib/auth";
import { toast } from "sonner";
import { Download, FileText, Save, Loader2, Plus, Trash2, PenLine, Users, Variable, Copy } from "lucide-react";
import { applyVars, buildChips, buildVarMap, loadPleadingContext, type LoadedContext, type VarChip } from "@/lib/pleading-variables";
import { promptFilename } from "@/lib/prompt-filename";
import { Badge } from "@/components/ui/badge";
export const Route = createFileRoute("/documents/pleading/new")({
@@ -244,11 +245,15 @@ function PleadingNewPage() {
const headerLine2 = `IN AND FOR ${county.toUpperCase()} COUNTY, FLORIDA`;
const onDownload = async () => {
await downloadPleading(input, docName || "Pleading");
const name = promptFilename(docName || "Pleading", "docx");
if (!name) return;
await downloadPleading(input, name);
};
const onDownloadPdf = async () => {
await downloadPleadingPdf(input, docName || "Pleading");
const name = promptFilename(docName || "Pleading", "pdf");
if (!name) return;
await downloadPleadingPdf(input, name);
};
const onSave = async () => {
@@ -12,6 +12,7 @@ import { useAuth } from "@/lib/auth";
import { toast } from "sonner";
import { Download, Loader2, Save, Trash2 } from "lucide-react";
import { downloadGeneric } from "@/lib/docx-pleading";
import { promptFilename } from "@/lib/prompt-filename";
import { Packer } from "docx";
export const Route = createFileRoute("/documents/templates/$templateId")({
@@ -120,9 +121,11 @@ function TemplateDetailPage() {
const fontSizePt: number = tpl?.font_size_pt || 12;
const downloadOnly = async () => {
const name = promptFilename(docName || "Document", "docx");
if (!name) return;
await downloadGeneric(
{ title: isLetter ? undefined : docName, body: merged, fontFamily, fontSizePt },
docName || "Document",
name,
);
};