Sửa đổi dữ liệu của hệ thống theo ARCHITECTURE.md

This commit is contained in:
2026-06-13 19:52:08 +07:00
parent 7fc80a49d0
commit b54707823c
33 changed files with 655 additions and 275 deletions
+13 -3
View File
@@ -6,10 +6,20 @@ import { useTourStore } from './useTourStore.js';
import { Map as MapIcon, Wallet, Image as ImageIcon, Calendar, Users, ChevronLeft } from 'lucide-react';
export const TourDetailPage = () => {
const [activeTab, setActiveTab] = useState('plan');
const { currentTour, fetchTour, userRole } = useTourStore();
const { currentTour, fetchTour, fetchPublicTours, publicTours, userRole } = useTourStore();
useEffect(() => {
fetchTour(1);
}, [fetchTour]);
const loadData = async () => {
if (publicTours.length === 0) {
await fetchPublicTours();
}
};
loadData();
}, []);
useEffect(() => {
if (publicTours.length > 0 && !currentTour) {
fetchTour(publicTours[0].id);
}
}, [publicTours, currentTour, fetchTour]);
const tabs = [
{ id: 'plan', label: 'Lộ trình', icon: MapIcon, visible: ['OWNER', 'EDITOR', 'MEMBER_PLAN_ONLY'].includes(userRole || '') },
{ id: 'expense', label: 'Chi phí', icon: Wallet, visible: ['OWNER', 'EDITOR'].includes(userRole || '') },