import React, { useState } from 'react';
// Importing icons from lucide-react
import { Plane, Car, Train, Utensils, CalendarDays, Mountain, MapPin, Mail, Phone, Home, Package, BookOpen } from 'lucide-react';
// Main App component
function App() {
const [currentPage, setCurrentPage] = useState('home'); // State to manage current page
// Navigation function
const navigateTo = (page) => {
setCurrentPage(page);
};
// Header Component
const Header = () => (
Wanderlust Tours
navigateTo('home')}
className={`text-white hover:text-teal-200 transition duration-300 flex items-center ${currentPage === 'home' ? 'font-semibold border-b-2 border-white' : ''}`}
>
Home
navigateTo('packages')}
className={`text-white hover:text-teal-200 transition duration-300 flex items-center ${currentPage === 'packages' ? 'font-semibold border-b-2 border-white' : ''}`}
>
Packages
navigateTo('booking')}
className={`text-white hover:text-teal-200 transition duration-300 flex items-center ${currentPage === 'booking' ? 'font-semibold border-b-2 border-white' : ''}`}
>
Book Now
);
// Footer Component
const Footer = () => (
);
// Home Page Component
const HomePage = () => (
Welcome to Wanderlust Tours!
Your ultimate guide to unforgettable travel experiences. We offer a wide range of packages tailored to your preferences,
whether you're looking for a quick getaway or an extended adventure. Explore our diverse destinations and travel modes
to find your perfect trip.
Flexible Durations
Choose packages from a few days to several weeks, fitting your schedule perfectly.
Food Options
Enjoy delicious meals with our food-inclusive packages or explore local cuisine on your own.
Diverse Travel Modes
Travel by air, train, or car – select the mode that suits your comfort and adventure level.
navigateTo('packages')}
className="mt-12 px-8 py-4 bg-teal-600 text-white text-xl font-bold rounded-full shadow-lg hover:bg-teal-700 transition duration-300 transform hover:scale-105"
>
Explore Packages
);
// Mock Data for Packages
const allPackages = [
{
id: 1,
name: "Himalayan Trek",
description: "An adventurous trek through the majestic Himalayas.",
days: 7,
food: true,
travelMode: "Flight",
price: 1200,
image: "https://placehold.co/400x250/A7F3D0/0D9488?text=Himalayan+Trek"
},
{
id: 2,
name: "Coastal Retreat",
description: "Relaxing beach vacation with stunning ocean views.",
days: 5,
food: false,
travelMode: "Car",
price: 800,
image: "https://placehold.co/400x250/99F6E4/0F766E?text=Coastal+Retreat"
},
{
id: 3,
name: "Desert Safari",
description: "Experience the thrill of desert dunes and starry nights.",
days: 3,
food: true,
travelMode: "Car",
price: 600,
image: "https://placehold.co/400x250/6EE7B7/065F46?text=Desert+Safari"
},
{
id: 4,
name: "Cultural City Tour",
description: "Immerse yourself in the rich history and culture of ancient cities.",
days: 4,
food: true,
travelMode: "Train",
price: 750,
image: "https://placehold.co/400x250/C3F7F7/004D40?text=City+Tour"
},
{
id: 5,
name: "Jungle Expedition",
description: "Explore the dense jungles and discover exotic wildlife.",
days: 10,
food: true,
travelMode: "Flight",
price: 1500,
image: "https://placehold.co/400x250/D1FAE5/047857?text=Jungle+Expedition"
},
{
id: 6,
name: "Mountain Lakeside",
description: "Peaceful retreat by a serene mountain lake.",
days: 6,
food: false,
travelMode: "Car",
price: 950,
image: "https://placehold.co/400x250/A7F3D0/0D9488?text=Lakeside+Retreat"
},
{
id: 7,
name: "Historical Landmarks",
description: "Journey through historical sites and learn about the past.",
days: 5,
food: true,
travelMode: "Train",
price: 850,
image: "https://placehold.co/400x250/99F6E4/0F766E?text=Historical+Tour"
},
{
id: 8,
name: "Island Hopping",
description: "Discover beautiful islands and enjoy water activities.",
days: 8,
food: true,
travelMode: "Flight",
price: 1800,
image: "https://placehold.co/400x250/6EE7B7/065F46?text=Island+Hopping"
},
];
// Packages Page Component
const PackagesPage = () => {
const [filters, setFilters] = useState({
days: '',
food: '',
travelMode: ''
});
const handleFilterChange = (e) => {
const { name, value } = e.target;
setFilters(prevFilters => ({
...prevFilters,
[name]: value
}));
};
const filteredPackages = allPackages.filter(pkg => {
const matchesDays = filters.days ? pkg.days <= parseInt(filters.days) : true;
const matchesFood = filters.food ? (filters.food === 'yes' ? pkg.food : !pkg.food) : true;
const matchesTravelMode = filters.travelMode ? pkg.travelMode === filters.travelMode : true;
return matchesDays && matchesFood && matchesTravelMode;
});
const getTravelModeIcon = (mode) => {
switch (mode) {
case 'Flight': return ;
case 'Car': return ;
case 'Train': return ;
default: return null;
}
};
return (
Our Tour Packages
{/* Filter Section */}
Filter Packages
Max Days:
Any
Up to 3 Days
Up to 5 Days
Up to 7 Days
Up to 10 Days
More than 10 Days
Food Included:
Any
Yes
No
Travel Mode:
Any
Flight
Car
Train
{/* Packages Display */}
{filteredPackages.length > 0 ? (
{filteredPackages.map(pkg => (
{ e.target.onerror = null; e.target.src = `https://placehold.co/400x250/E0F2F7/00796B?text=${pkg.name.replace(/\s/g, '+')}`; }} />
{pkg.name}
{pkg.description}
{pkg.days} Days
Food: {pkg.food ? 'Included' : 'Not Included'}
{getTravelModeIcon(pkg.travelMode)}
Travel Mode: {pkg.travelMode}
${pkg.price}
navigateTo('booking')}
className="bg-teal-500 text-white px-6 py-2 rounded-full hover:bg-teal-600 transition duration-300 shadow-md"
>
Book Now
))}
) : (
No packages found matching your filters. Try adjusting your selections.
)}
);
};
// Booking Page Component
const BookingPage = () => {
const [formData, setFormData] = useState({
name: '',
email: '',
phone: '',
packageInterest: '',
message: ''
});
const [submissionStatus, setSubmissionStatus] = useState(null); // 'success' or 'error'
const handleInputChange = (e) => {
const { name, value } = e.target;
setFormData(prevData => ({
...prevData,
[name]: value
}));
};
const handleSubmit = (e) => {
e.preventDefault();
// In a real application, you would send this data to a backend server.
console.log('Booking Form Submitted:', formData);
// Simulate API call success/failure
setTimeout(() => {
const success = Math.random() > 0.2; // 80% chance of success
if (success) {
setSubmissionStatus('success');
setFormData({ name: '', email: '', phone: '', packageInterest: '', message: '' }); // Clear form
} else {
setSubmissionStatus('error');
}
}, 1000);
};
return (
Book Your Dream Tour
Fill out the form below and our team will get back to you shortly to help plan your perfect trip.
{submissionStatus === 'success' && (
Thank you for your inquiry! We've received your message and will contact you soon.
)}
{submissionStatus === 'error' && (
Oops! Something went wrong. Please try again later.
)}
);
};
// Main App render logic
const renderPage = () => {
switch (currentPage) {
case 'home':
return ;
case 'packages':
return ;
case 'booking':
return ;
default:
return ;
}
};
return (
{renderPage()}
);
}
export default App;