diff --git a/app-9xzmfic2e4g1/src/components/trip/Timeline.tsx b/app-9xzmfic2e4g1/src/components/trip/Timeline.tsx index c7f34c8..c576c54 100644 --- a/app-9xzmfic2e4g1/src/components/trip/Timeline.tsx +++ b/app-9xzmfic2e4g1/src/components/trip/Timeline.tsx @@ -38,13 +38,11 @@ function formatTime(mins: number): string { return `${String(Math.floor(mins / 60) % 24).padStart(2, '0')}:${String(mins % 60).padStart(2, '0')}`; } -/** Compute end_time from start_time + estimated_duration_minutes */ function calcEndTime(item: Place): string { const start = parseMinutes(item.start_time || '09:00'); return formatTime(start + (item.estimated_duration_minutes || 60)); } -/** Time-of-day segment label */ function getSegment(time: string): 'morning' | 'afternoon' | 'evening' { const mins = parseMinutes(time); if (mins < 12 * 60) return 'morning'; @@ -53,9 +51,9 @@ function getSegment(time: string): 'morning' | 'afternoon' | 'evening' { } const SEGMENT_META = { - morning: { label: 'Sabah', icon: Sun, color: 'text-amber-500' }, - afternoon: { label: 'Öğleden Sonra', icon: Coffee, color: 'text-orange-500' }, - evening: { label: 'Akşam', icon: Sunset, color: 'text-rose-500' }, + morning: { label: 'Sabah', icon: Sun, color: 'text-amber-500' }, + afternoon: { label: 'Öğleden Sonra', icon: Coffee, color: 'text-orange-500' }, + evening: { label: 'Akşam', icon: Sunset, color: 'text-rose-500' }, }; // ──────────────────────────────────────────────────────────────────────────── @@ -112,7 +110,6 @@ function DaySection({ } }; - // Group items by time-of-day const grouped = useMemo(() => { const segments: Record = {}; for (const item of day.items) { @@ -189,7 +186,6 @@ function DaySection({ if (!items?.length) return null; const meta = SEGMENT_META[seg]; const SegIcon = meta.icon; - const globalOffset = day.items.indexOf(items[0]); return (
@@ -272,7 +268,7 @@ function DaySection({ } // ──────────────────────────────────────────────────────────────────────────── -// SortableItem — redesigned with larger photo +// SortableItem — Wanderlog stili küçük thumbnail // ──────────────────────────────────────────────────────────────────────────── function SortableItem({ item, index, isActive, onClick, onDelete, onUpdateNote @@ -319,66 +315,24 @@ function SortableItem({ : "border-gray-100 hover:border-gray-200 hover:shadow-md" )} > - {/* Photo (16:9) */} - {photoUrl && !imgError && ( -
- {!imgLoaded && ( -
- )} - {item.name} setImgLoaded(true)} - onError={() => setImgError(true)} - className={cn( - "w-full h-full object-cover transition-all duration-500", - imgLoaded ? "opacity-100 scale-100" : "opacity-0 scale-105" - )} - /> - {/* Time badge on photo */} -
- {item.start_time || '09:00'} – {endTime} -
- {/* Rating badge */} - {item.rating && ( -
- - {item.rating} -
- )} - {/* Index bubble */} -
+ + {/* Ana satır */} +
+ + {/* Index numarası */} +
{index + 1}
-
- )} - - {/* No photo: compact row layout */} - {(!photoUrl || imgError) && ( -
-
- {index + 1} -
- {item.start_time && ( - - {item.start_time} – {endTime} - - )} - {item.rating && ( - - - {item.rating} - - )} -
- )} - - {/* Name + actions */} -
+ {/* Bilgi alanı */}

{item.name}

-
+
+ {item.start_time && ( + + {item.start_time} – {endTime} + + )} {item.category} @@ -388,9 +342,35 @@ function SortableItem({ {item.estimated_duration_minutes}dk )} + {item.rating && ( + + + {item.rating} + + )}
+ {/* Küçük thumbnail */} + {photoUrl && !imgError && ( +
+ {!imgLoaded && ( +
+ )} + {item.name} setImgLoaded(true)} + onError={() => setImgError(true)} + className={cn( + "w-full h-full object-cover transition-opacity duration-300", + imgLoaded ? "opacity-100" : "opacity-0" + )} + /> +
+ )} + + {/* Aksiyonlar (hover'da görünür) */}
- { e.stopPropagation(); setIsEditingNote(true); }} className="text-xs font-bold gap-2 rounded-lg"> + { e.stopPropagation(); setIsEditingNote(true); }} + className="text-xs font-bold gap-2 rounded-lg" + > Not Düzenle
- {/* Note */} + {/* Not düzenleme alanı */} {isEditingNote && ( + {/* Mevcut not gösterimi */} {!isEditingNote && item.notes && (

{item.notes}