fix: eslint and build
This commit is contained in:
@@ -8,15 +8,11 @@ import { ConceptPrice, ConceptAutomation } from '../../Landing/ConceptIllustrati
|
||||
import { Info, Download, Share2, RefreshCw } from 'lucide-react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { EstimationPDF } from '../../EstimationPDF';
|
||||
// EstimationPDF will be imported dynamically where used or inside the and client-side block
|
||||
import IconWhite from '../../../assets/logo/Icon White Transparent.png';
|
||||
import LogoBlack from '../../../assets/logo/Logo Black Transparent.png';
|
||||
|
||||
// Dynamically import PDF components to avoid SSR issues
|
||||
const PDFDownloadLink = dynamic(
|
||||
() => import('@react-pdf/renderer').then((mod) => mod.PDFDownloadLink),
|
||||
{ ssr: false }
|
||||
);
|
||||
// PDF components removed from top-level dynamic import to fix ESM resolution issues in Next.js 16/Webpack
|
||||
|
||||
interface PriceCalculationProps {
|
||||
state: FormState;
|
||||
@@ -44,8 +40,7 @@ export function PriceCalculation({
|
||||
setPdfLoading(true);
|
||||
|
||||
try {
|
||||
const { pdf } = await import('@react-pdf/renderer');
|
||||
|
||||
const { EstimationPDF } = await import('../../EstimationPDF');
|
||||
const doc = <EstimationPDF
|
||||
state={state}
|
||||
totalPrice={totalPrice}
|
||||
@@ -56,6 +51,8 @@ export function PriceCalculation({
|
||||
footerLogo={typeof LogoBlack === 'string' ? LogoBlack : (LogoBlack as any).src}
|
||||
/>;
|
||||
|
||||
const { pdf } = await import('@react-pdf/renderer');
|
||||
|
||||
// Minimum loading time of 2 seconds for better UX
|
||||
const [blob] = await Promise.all([
|
||||
pdf(doc).toBlob(),
|
||||
|
||||
Reference in New Issue
Block a user