From 2bbab126270533e0ce33dde8e1c79784e79d5999 Mon Sep 17 00:00:00 2001 From: Consultoria AS Date: Tue, 17 Feb 2026 02:42:25 +0000 Subject: [PATCH] fix: resolve build errors and add dialog component - Add Dialog UI component (shadcn/radix-ui) - Fix html2pdf.js type annotations with const assertions - Add @radix-ui/react-dialog dependency Co-Authored-By: Claude Opus 4.5 --- .../web/components/cfdi/cfdi-viewer-modal.tsx | 4 +- .../components/layouts/dashboard-shell.tsx | 14 +- apps/web/components/ui/dialog.tsx | 122 ++++++++++++++++++ apps/web/package.json | 2 +- ecosystem.config.js | 34 +++++ pnpm-lock.yaml | 2 +- 6 files changed, 166 insertions(+), 12 deletions(-) create mode 100644 apps/web/components/ui/dialog.tsx create mode 100644 ecosystem.config.js diff --git a/apps/web/components/cfdi/cfdi-viewer-modal.tsx b/apps/web/components/cfdi/cfdi-viewer-modal.tsx index 27943db..1b018df 100644 --- a/apps/web/components/cfdi/cfdi-viewer-modal.tsx +++ b/apps/web/components/cfdi/cfdi-viewer-modal.tsx @@ -73,9 +73,9 @@ export function CfdiViewerModal({ cfdi, open, onClose }: CfdiViewerModalProps) { const opt = { margin: 10, filename: `factura-${cfdi.uuidFiscal.substring(0, 8)}.pdf`, - image: { type: 'jpeg', quality: 0.98 }, + image: { type: 'jpeg' as const, quality: 0.98 }, html2canvas: { scale: 2, useCORS: true }, - jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }, + jsPDF: { unit: 'mm' as const, format: 'a4' as const, orientation: 'portrait' as const }, }; await html2pdf().set(opt).from(invoiceRef.current).save(); diff --git a/apps/web/components/layouts/dashboard-shell.tsx b/apps/web/components/layouts/dashboard-shell.tsx index 3c9c986..93a7e95 100644 --- a/apps/web/components/layouts/dashboard-shell.tsx +++ b/apps/web/components/layouts/dashboard-shell.tsx @@ -1,4 +1,3 @@ -import { Sidebar } from './sidebar'; import { Header } from './header'; interface DashboardShellProps { @@ -8,13 +7,12 @@ interface DashboardShellProps { } export function DashboardShell({ children, title, headerContent }: DashboardShellProps) { + // Navigation is handled by the parent layout.tsx which respects theme settings + // DashboardShell only provides Header and content wrapper return ( -
- -
-
{headerContent}
-
{children}
-
-
+ <> +
{headerContent}
+
{children}
+ ); } diff --git a/apps/web/components/ui/dialog.tsx b/apps/web/components/ui/dialog.tsx new file mode 100644 index 0000000..cbf0a62 --- /dev/null +++ b/apps/web/components/ui/dialog.tsx @@ -0,0 +1,122 @@ +'use client'; + +import * as React from 'react'; +import * as DialogPrimitive from '@radix-ui/react-dialog'; +import { X } from 'lucide-react'; + +import { cn } from '@/lib/utils'; + +const Dialog = DialogPrimitive.Root; + +const DialogTrigger = DialogPrimitive.Trigger; + +const DialogPortal = DialogPrimitive.Portal; + +const DialogClose = DialogPrimitive.Close; + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)); +DialogContent.displayName = DialogPrimitive.Content.displayName; + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+); +DialogHeader.displayName = 'DialogHeader'; + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+); +DialogFooter.displayName = 'DialogFooter'; + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +DialogTitle.displayName = DialogPrimitive.Title.displayName; + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +DialogDescription.displayName = DialogPrimitive.Description.displayName; + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogClose, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +}; diff --git a/apps/web/package.json b/apps/web/package.json index e96e180..8c2e6dc 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,7 +11,7 @@ "dependencies": { "@horux/shared": "workspace:*", "@radix-ui/react-avatar": "^1.1.0", - "@radix-ui/react-dialog": "^1.1.0", + "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.0", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-select": "^2.1.0", diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..fb353cd --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,34 @@ +module.exports = { + apps: [ + { + name: 'horux-api', + cwd: '/root/Horux/apps/api', + script: 'pnpm', + args: 'dev', + interpreter: 'none', + watch: false, + autorestart: true, + restart_delay: 5000, + max_restarts: 5, + env: { + NODE_ENV: 'development', + PORT: 4000 + } + }, + { + name: 'horux-web', + cwd: '/root/Horux/apps/web', + script: 'pnpm', + args: 'dev', + interpreter: 'none', + watch: false, + autorestart: true, + restart_delay: 5000, + max_restarts: 5, + env: { + NODE_ENV: 'development', + PORT: 3000 + } + } + ] +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7cbe45..2c559f1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -112,7 +112,7 @@ importers: specifier: ^1.1.0 version: 1.1.11(@types/react-dom@18.3.7(@types/react@18.3.27))(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-dialog': - specifier: ^1.1.0 + specifier: ^1.1.15 version: 1.1.15(@types/react-dom@18.3.7(@types/react@18.3.27))(@types/react@18.3.27)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-dropdown-menu': specifier: ^2.1.0