import type { ImageLoadingState } from '@documenso/lib/client-only/providers/envelope-render-provider'; import { cn } from '@documenso/ui/lib/utils'; import { Spinner } from '@documenso/ui/primitives/spinner'; import { Trans } from '@lingui/react/macro'; type PdfViewerPageImageProps = { imageLoadingState: ImageLoadingState; imageProps: React.ImgHTMLAttributes & Record & { alt: '' }; }; export const PdfViewerPageImage = ({ imageLoadingState, imageProps }: PdfViewerPageImageProps) => { return ( <> {/* Loading State */} {imageLoadingState === 'loading' && (
)} {imageLoadingState === 'error' && (

Error loading page

)} {/* The PDF image. */} {imageProps.src && ( )} ); };