mirror of
https://github.com/hanzoai/sign.git
synced 2026-11-02 23:26:15 +00:00
The product is branded Hanzo eSign (esign.hanzo.ai, repo hanzoai/esign). Rename all workspace packages @hanzo/sign-* → @hanzo/esign-* (1052 files) and align docker/Dockerfile turbo --scope/--filter to the actual remix package name @hanzo/esign (was a pre-existing mismatch with -remix that broke the build). Protected deps (@hanzo/insights, @hanzo/logo) untouched.
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { Trans } from '@lingui/react/macro';
|
|
|
|
import type { ImageLoadingState } from '@hanzo/esign-lib/client-only/providers/envelope-render-provider';
|
|
import { cn } from '@hanzo/esign-ui/lib/utils';
|
|
import { Spinner } from '@hanzo/esign-ui/primitives/spinner';
|
|
|
|
type PdfViewerPageImageProps = {
|
|
imageLoadingState: ImageLoadingState;
|
|
imageProps: React.ImgHTMLAttributes<HTMLImageElement> & Record<string, unknown> & { alt: '' };
|
|
};
|
|
|
|
export const PdfViewerPageImage = ({ imageLoadingState, imageProps }: PdfViewerPageImageProps) => {
|
|
return (
|
|
<>
|
|
{/* Loading State */}
|
|
{imageLoadingState === 'loading' && (
|
|
<div className="absolute inset-0 z-10 flex items-center justify-center text-muted-foreground opacity-20">
|
|
<Spinner />
|
|
</div>
|
|
)}
|
|
|
|
{imageLoadingState === 'error' && (
|
|
<div className="absolute inset-0 z-10 flex items-center justify-center">
|
|
<p>
|
|
<Trans>Error loading page</Trans>
|
|
</p>
|
|
</div>
|
|
)}
|
|
|
|
{/* The PDF image. */}
|
|
{imageProps.src && <img {...imageProps} className={cn(imageProps.className, '')} alt="" />}
|
|
</>
|
|
);
|
|
};
|