import React, { useState } from 'react' import { useDroppable } from '@dnd-kit/core' import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable' import AssignedPlaceItem from './AssignedPlaceItem' import { ChevronDown, ChevronUp, Plus, FileText, Package, DollarSign } from 'lucide-react' export default function DayColumn({ day, assignments, tripId, onRemoveAssignment, onEditPlace, onQuickAdd, }) { const [isCollapsed, setIsCollapsed] = useState(false) const [showNotes, setShowNotes] = useState(false) const [notes, setNotes] = useState(day.notes || '') const [notesEditing, setNotesEditing] = useState(false) const { isOver, setNodeRef } = useDroppable({ id: `day-${day.id}`, data: { type: 'day', dayId: day.id, }, }) const sortableIds = (assignments || []).map(a => `assignment-${a.id}`) const totalCost = (assignments || []).reduce((sum, a) => { return sum + (a.place?.price ? Number(a.place.price) : 0) }, 0) const formatDate = (dateStr) => { if (!dateStr) return null const d = new Date(dateStr + 'T00:00:00') return d.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' }) } return (
{/* Header */}
Day {day.day_number} {assignments?.length || 0}
{day.date && (

{formatDate(day.date)}

)}
{totalCost > 0 && ( {totalCost.toLocaleString()} )}
{/* Notes area */} {showNotes && (