feat: nhấn nút toggle status để chuyển đến bản đồ di chuyển

This commit is contained in:
2026-06-17 21:30:41 +07:00
parent ffe3cb6ecd
commit 55de887f87
2 changed files with 20 additions and 4 deletions
@@ -42,12 +42,14 @@ export const ItineraryTimeline = ({
onAddLocation,
onEditLocation,
onQuickNote,
onNavigate,
onSuccess,
isPublicView = false
}: {
onAddLocation?: (legId: string, isStart?: boolean, isEnd?: boolean) => void,
onEditLocation?: (location: any) => void,
onQuickNote?: (name: string) => void,
onNavigate?: (location: any) => void,
onSuccess?: () => void,
isPublicView?: boolean
}) => {
@@ -113,9 +115,10 @@ export const ItineraryTimeline = ({
endDate: ''
});
const toggleComplete = async (locationId: string) => {
// Gọi API PATCH /api/v1/locations/:id để cập nhật trạng thái
console.log("Toggle status for location:", locationId);
const handleStatusClick = (location: any) => {
if (onNavigate) {
onNavigate(location);
}
};
const handleAddLeg = async () => {
@@ -371,7 +374,7 @@ export const ItineraryTimeline = ({
{/* Timeline Node */}
<div className="z-10 mt-1.5 mr-4">
<button
onClick={() => toggleComplete(location.id)}
onClick={() => handleStatusClick(location)}
className={`transition-colors duration-200 ${location.status === 'COMPLETED' ? 'text-green-500' : 'text-gray-300 hover:text-blue-500'}`}
>
{location.status === 'COMPLETED' ? (