diff --git a/Dockerfile b/Dockerfile
index 4b8e573..4a5c1b4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,8 +9,8 @@ WORKDIR /app
# Install git early for commit hash
RUN apk add --no-cache git
-# Install pnpm with cache mount for better performance
-RUN npm install -g pnpm
+# Install pnpm properly for Docker
+RUN corepack enable && corepack prepare pnpm@latest --activate
# Copy package files for dependency installation
COPY package.json pnpm-lock.yaml ./
@@ -45,6 +45,9 @@ FROM node:20-alpine AS runner
# Set working directory inside the container
WORKDIR /app
+# Install pnpm in production stage
+RUN corepack enable && corepack prepare pnpm@latest --activate
+
RUN mkdir -p /app/public
# Copy only necessary files from builder
diff --git a/components/dashboard/ChatDetail.tsx b/components/dashboard/ChatDetail.tsx
index 81ab8ae..6a1f3ea 100644
--- a/components/dashboard/ChatDetail.tsx
+++ b/components/dashboard/ChatDetail.tsx
@@ -13,6 +13,7 @@ import { toast } from "sonner";
import { ArrowLeft, Send, RefreshCw, File, FileText, Image as ImageIcon, Download } from "lucide-react";
import { getCookie, clientFetch } from "@/lib/api";
import { ImageViewerModal } from "@/components/modals/image-viewer-modal";
+import Image from "next/image";
import BuyerOrderInfo from "./BuyerOrderInfo";
import { useIsTouchDevice } from "@/hooks/use-mobile";
import { useChromebookScroll, useSmoothScrollToBottom } from "@/hooks/use-chromebook-scroll";
@@ -742,13 +743,23 @@ export default function ChatDetail({ chatId }: { chatId: string }) {
-
{
- (e.target as HTMLImageElement).src = "/placeholder-image.svg";
+ // Fallback to placeholder on error
+ const target = e.target as any;
+ if (target && target.src !== "/placeholder-image.svg") {
+ target.src = "/placeholder-image.svg";
+ }
}}
+ onClick={() => handleImageClick(attachment, messageIndex, attachmentIndex)}
/>
) : (
diff --git a/components/forms/image-upload.tsx b/components/forms/image-upload.tsx
index a60be01..6e4cfab 100644
--- a/components/forms/image-upload.tsx
+++ b/components/forms/image-upload.tsx
@@ -2,6 +2,7 @@
import { ChangeEvent } from "react";
import { Input } from "@/components/ui/input";
+import Image from "next/image";
interface ImageUploadProps {
imagePreview: string | null;
@@ -21,9 +22,15 @@ export const ImageUpload = ({
style={{ width: imageDimensions.width, height: imageDimensions.height }}
>
{imagePreview ? (
-
) : (
diff --git a/components/modals/broadcast-dialog.tsx b/components/modals/broadcast-dialog.tsx
index 3226f23..b1a9e7e 100644
--- a/components/modals/broadcast-dialog.tsx
+++ b/components/modals/broadcast-dialog.tsx
@@ -7,6 +7,7 @@ import { Send, Bold, Italic, Code, Link as LinkIcon, Image as ImageIcon, X, Eye,
import { toast } from "sonner";
import { clientFetch } from "@/lib/api";
import { Textarea } from "@/components/ui/textarea";
+import Image from "next/image";
import ProductSelector from "./product-selector";
const ReactMarkdown = lazy(() => import('react-markdown'));
@@ -275,9 +276,15 @@ __italic text__
{imagePreview && (
-