Sửa đổi dữ liệu của hệ thống theo ARCHITECTURE.md
This commit is contained in:
Vendored
+13
-3
@@ -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 || '') },
|
||||
|
||||
Reference in New Issue
Block a user