mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
This change actually makes the authoring flow work for the most part by tying in emailing and more. We have also done a number of quality of life updates to simplify the codebase overall making it easier to continue work on the refresh.
36 lines
1008 B
TypeScript
36 lines
1008 B
TypeScript
'use client';
|
|
|
|
import dynamic from 'next/dynamic';
|
|
|
|
import { Loader } from 'lucide-react';
|
|
|
|
import { Card, CardContent } from '@documenso/ui/primitives/card';
|
|
|
|
import { PDFViewerProps } from '~/components/(dashboard)/pdf-viewer/pdf-viewer';
|
|
|
|
export type LoadablePDFCard = PDFViewerProps & {
|
|
className?: string;
|
|
pdfClassName?: string;
|
|
};
|
|
|
|
const PDFViewer = dynamic(async () => import('~/components/(dashboard)/pdf-viewer/pdf-viewer'), {
|
|
ssr: false,
|
|
loading: () => (
|
|
<div className="flex-col flex min-h-[80vh] items-center justify-center bg-white/50">
|
|
<Loader className="h-12 w-12 animate-spin text-slate-500" />
|
|
|
|
<p className="mt-4 text-slate-500">Loading document...</p>
|
|
</div>
|
|
),
|
|
});
|
|
|
|
export const LoadablePDFCard = ({ className, pdfClassName, ...props }: LoadablePDFCard) => {
|
|
return (
|
|
<Card className={className} gradient {...props}>
|
|
<CardContent className="p-2">
|
|
<PDFViewer className={pdfClassName} {...props} />
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
};
|