From 2cbde94b2fdcf2b0d0cc384d8c0bd2c20e31ec46 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Fri, 5 Sep 2025 12:58:10 +0000 Subject: [PATCH] Add a clickable icon to view delivery comments in the calendar Integrate a modal dialog triggered by a new `MessageSquare` icon within `CalendarItem` component to display delivery notes when present. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dc17873f-d870-4f45-9108-207794b849f7 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/dc17873f-d870-4f45-9108-207794b849f7/Wa8YSgr --- client/src/components/CalendarGrid.tsx | 70 +++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/client/src/components/CalendarGrid.tsx b/client/src/components/CalendarGrid.tsx index 69f8005..be66b5e 100644 --- a/client/src/components/CalendarGrid.tsx +++ b/client/src/components/CalendarGrid.tsx @@ -1,10 +1,33 @@ import { format, startOfMonth, endOfMonth, eachDayOfInterval, isSameDay, isSameMonth, isToday } from "date-fns"; import { fr } from "date-fns/locale"; import { safeDate } from "@/lib/dateUtils"; -import { Plus, Check, MoreHorizontal, Package, Link } from "lucide-react"; +import { Plus, Check, MoreHorizontal, Package, Link, MessageSquare } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; import { useState } from "react"; + +// Composant modal pour afficher les commentaires +function CommentModal({ isOpen, onClose, comment }: { isOpen: boolean, onClose: () => void, comment: string }) { + if (!isOpen) return null; + + return ( + + ); +} import type { OrderWithRelations, DeliveryWithRelations } from "@shared/schema"; interface CalendarGridProps { @@ -20,6 +43,8 @@ interface CalendarGridProps { // Composant pour afficher un élément (commande ou livraison) function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' | 'delivery', onItemClick: (item: any, type: 'order' | 'delivery') => void }) { + const [showCommentModal, setShowCommentModal] = useState(false); + const formatQuantity = (quantity: number, unit: string) => { return `${quantity}${unit === 'palettes' ? 'P' : 'C'}`; }; @@ -94,6 +119,19 @@ function CalendarItem({ item, type, onItemClick }: { item: any, type: 'order' | {item.supplier?.name || 'Livraison'} - {formatQuantity(item.quantity, item.unit)}