diff --git a/src/components/upload/PhotoCaptionEditor.tsx b/src/components/upload/PhotoCaptionEditor.tsx index 4ad7d7d2..09b63721 100644 --- a/src/components/upload/PhotoCaptionEditor.tsx +++ b/src/components/upload/PhotoCaptionEditor.tsx @@ -4,14 +4,18 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; -import { X, Eye, GripVertical, Edit3 } from 'lucide-react'; +import { Calendar } from '@/components/ui/calendar'; +import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; +import { X, Eye, GripVertical, Edit3, CalendarIcon } from 'lucide-react'; import { cn } from '@/lib/utils'; +import { format } from 'date-fns'; export interface PhotoWithCaption { url: string; // Object URL for preview, Cloudflare URL after upload file?: File; // The actual file to upload later caption: string; title?: string; + date?: Date; // Optional date for the photo order: number; uploadStatus?: 'pending' | 'uploading' | 'uploaded' | 'failed'; } @@ -47,6 +51,13 @@ export function PhotoCaptionEditor({ onPhotosChange(updatedPhotos); }; + const updatePhotoDate = (index: number, date: Date | undefined) => { + const updatedPhotos = photos.map((photo, i) => + i === index ? { ...photo, date } : photo + ); + onPhotosChange(updatedPhotos); + }; + const movePhoto = (fromIndex: number, toIndex: number) => { const updatedPhotos = [...photos]; const [movedPhoto] = updatedPhotos.splice(fromIndex, 1); @@ -143,6 +154,48 @@ export function PhotoCaptionEditor({ className="h-8 text-sm" /> +