- {title ?
{title} : null}
- {description ? (
-
{description}
+
+
+ {icon ? (
+
+ {" "}
+ {icon}{" "}
+
) : null}
+
+
+ {title ? {title} : null}
+ {description ? (
+ {description}
+ ) : null}
+
+ {actions ? <>{actions}> : null}
)}
diff --git a/packages/rdx-ui/src/components/pdf-viewer.tsx b/packages/rdx-ui/src/components/pdf-viewer.tsx
index 2dbeddb6..24692555 100644
--- a/packages/rdx-ui/src/components/pdf-viewer.tsx
+++ b/packages/rdx-ui/src/components/pdf-viewer.tsx
@@ -1,3 +1,4 @@
+import { FormSectionCard, FormSectionGrid } from "@repo/rdx-ui/components";
import {
Button,
Select,
@@ -7,8 +8,14 @@ import {
SelectValue,
Spinner,
} from "@repo/shadcn-ui/components";
-import { cn } from "@repo/shadcn-ui/lib/utils";
-import { DownloadIcon, ExternalLinkIcon, PrinterIcon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
+import {
+ DownloadIcon,
+ ExternalLinkIcon,
+ EyeIcon,
+ PrinterIcon,
+ ZoomInIcon,
+ ZoomOutIcon,
+} from "lucide-react";
import { useEffect, useMemo, useRef, useState } from "react";
const DEFAULT_ZOOM_OPTIONS = [50, 75, 100, 125, 150];
@@ -77,8 +84,10 @@ export function PDFViewer({
const updateFitZoom = () => {
const styles = window.getComputedStyle(element);
- const paddingX = Number.parseFloat(styles.paddingLeft) + Number.parseFloat(styles.paddingRight);
- const paddingY = Number.parseFloat(styles.paddingTop) + Number.parseFloat(styles.paddingBottom);
+ const paddingX =
+ Number.parseFloat(styles.paddingLeft) + Number.parseFloat(styles.paddingRight);
+ const paddingY =
+ Number.parseFloat(styles.paddingTop) + Number.parseFloat(styles.paddingBottom);
const availableWidth = Math.max(element.clientWidth - paddingX, 320);
const availableHeight = Math.max(element.clientHeight - paddingY, 320);
const widthScale = availableWidth / PDF_PAGE_WIDTH;
@@ -143,13 +152,8 @@ export function PDFViewer({
};
return (
-
-
-
-
{title}
-
{description}
-
-
+
-
-
-
- {loading ? (
-
-
-
- Cargando vista previa del PDF...
+ }
+ className="shadow-sm"
+ contentClassName="space-y-5"
+ description={description}
+ icon={
}
+ title={title}
+ >
+
+
+ {loading ? (
+
+
+
+ Cargando vista previa del PDF...
+
-
- ) : null}
+ ) : null}
- {!loading && error ? (
-
-
-
No se pudo cargar la vista previa
-
{error}
+ {!loading && error ? (
+
+
+
No se pudo cargar la vista previa
+
{error}
+
-
- ) : null}
+ ) : null}
- {!(loading || error) && resolvedSrc ? (
-
-
-
+ {!(loading || error) && resolvedSrc ? (
+
-
- ) : null}
+ ) : null}
- {loading || error || resolvedSrc ? null : (
-
-
-
Vista previa no disponible
-
- El PDF de la proforma todavía no está listo para mostrarse.
-
+ {loading || error || resolvedSrc ? null : (
+
+
+
Vista previa no disponible
+
+ El PDF de la proforma todavía no está listo para mostrarse.
+
+
-
- )}
-
-
+ )}
+
+
+
);
}