@@ -527,43 +527,33 @@ export function StoryboardGenerator({ projects }: Props) {
});
}, []);
- // ── Print styles ────────────────────────────────────────────────────────────
- const printStyles = useMemo(() => {
- const isFullscreen = layout === "fullscreen";
- return `
- @media print {
- .no-print { display: none !important; }
- .print-area { display: block !important; }
- body { background: ${isFullscreen ? "#000" : "#fff"} !important; margin: 0; }
- @page {
- size: ${isFullscreen ? "A4 landscape" : "A4 portrait"};
- margin: ${isFullscreen ? "0" : "12mm 12mm 10mm 12mm"};
- }
- .sb-page-break { break-after: page; page-break-after: always; }
- .sb-avoid-break { break-inside: avoid; page-break-inside: avoid; }
- .sb-force-break { break-before: page; page-break-before: always; }
- .print\\:bg-white { background: #fff !important; }
- .print\\:bg-black { background: #000 !important; }
- .print\\:text-black { color: #000 !important; }
- .print\\:text-zinc-700 { color: #3f3f46 !important; }
- .print\\:border-zinc-300 { border-color: #d4d4d8 !important; }
- .print\\:h-screen { height: 100vh !important; }
- .print\\:mb-0 { margin-bottom: 0 !important; }
- .print\\:mt-0 { margin-top: 0 !important; }
- .print\\:space-y-6 > * + * { margin-top: 1.5rem !important; }
- .print\\:gap-2 { gap: 0.5rem !important; }
- .print\\:py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
- }
- `;
- }, [layout]);
+ // ── PDF URL (opens in new tab → auto-triggers browser print dialog) ─────────────────────
+ const pdfUrl = useMemo(() => {
+ const params = new URLSearchParams({
+ projectId,
+ layout,
+ columns: String(columns),
+ groupBy,
+ desc: includeDescription ? "1" : "0",
+ notes: includeNotes ? "1" : "0",
+ frameRange: includeFrameRange ? "1" : "0",
+ status: includeStatus ? "1" : "0",
+ version: includeVersion ? "1" : "0",
+ pageBreaks: pageBreakBetweenGroups ? "1" : "0",
+ onlyThumbs: showOnlyWithThumbnails ? "1" : "0",
+ });
+ if (selectedEpisodes.size > 0) params.set("episodes", [...selectedEpisodes].join(","));
+ if (selectedGroups.size > 0) params.set("groups", [...selectedGroups].join(","));
+ return `/api/storyboard/pdf?${params}`;
+ }, [
+ projectId, layout, columns, groupBy,
+ includeDescription, includeNotes, includeFrameRange, includeStatus, includeVersion,
+ pageBreakBetweenGroups, showOnlyWithThumbnails, selectedEpisodes, selectedGroups,
+ ]);
// ─── Render ──────────────────────────────────────────────────────────────────
return (
- <>
- {/* Print styles injected dynamically */}
-
-
-
+
{/* ── Controls sidebar ── */}
{/* Header */}
@@ -740,19 +730,24 @@ export function StoryboardGenerator({ projects }: Props) {
{/* Generate button */}
- {layout === "fullscreen" && (
+ {layout === "fullscreen" && (
- Tip: choose Landscape in the print dialog for best results
+ Tip: choose Landscape in the print dialog
)}
-
+ {filteredShots.length > 0 ? (
+
+
+
+ ) : (
+
+ )}
@@ -770,7 +765,7 @@ export function StoryboardGenerator({ projects }: Props) {
{/* Storyboard content */}
-
+
{isLoading ? (
@@ -801,9 +796,8 @@ export function StoryboardGenerator({ projects }: Props) {
projectName={project?.name ?? ""}
/>
)}
-
- >
+
);
}