Skip to content

Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.

add loading.tsx (suspense)

VladSez8e429cbb6d89
diff --git a/src/app/loading.tsx b/src/app/loading.tsx
new file mode 100644
index 0000000..79afa14
--- /dev/null
+++ b/src/app/loading.tsx
@@ -0,0 +1,35 @@
+export default function Loading() {
+ return (
+ <div className="min-h-screen p-8 bg-gray-50">
+ <div className="flex flex-col lg:flex-row gap-8 max-w-[1400px] mx-auto">
+ {/* Left side - Form */}
+ <div className="w-full lg:w-1/3 space-y-6">
+ <div className="h-8 w-64 bg-gray-200 rounded animate-pulse" />
+
+ {/* Form fields skeleton */}
+ <div className="space-y-4">
+ {[...Array(6)].map((_, i) => (
+ <div key={i} className="space-y-2">
+ <div className="h-4 w-32 bg-gray-200 rounded animate-pulse" />
+ <div className="h-10 bg-gray-200 rounded animate-pulse" />
+ </div>
+ ))}
+ </div>
+ </div>
+
+ {/* Right side - PDF Preview */}
+ <div className="w-full lg:w-2/3">
+ <div className="bg-gray-200 rounded-lg h-[700px] animate-pulse">
+ <div className="flex justify-between items-center p-4 bg-gray-300 rounded-t-lg">
+ <div className="h-6 w-48 bg-gray-400 rounded animate-pulse" />
+ <div className="flex gap-2">
+ <div className="h-8 w-32 bg-gray-400 rounded animate-pulse" />
+ <div className="h-8 w-32 bg-blue-400 rounded animate-pulse" />
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}