"use client"; import { ArrowLeft, Calendar, DollarSign, Download, Eye, Hotel, MapPin, Plane, Share2, Star, TrendingUp, Users, } from "lucide-react"; import { useState } from "react"; import { Link } from "react-router-dom"; type TourPurchase = { id: number; userName: string; userPhone: string; tourName: string; tourId: number; agencyName: string; agencyId: number; destination: string; travelDate: string; amount: number; paymentStatus: "paid" | "pending" | "cancelled" | "refunded"; purchaseDate: string; rating: number; review: string; }; const mockTourData = { id: 1, name: "Dubai Luxury Tour", destination: "Dubai, UAE", duration: "7 days", price: 1500000, totalBookings: 45, totalRevenue: 67500000, averageRating: 4.8, agency: "Silk Road Travel", description: "Experience the ultimate luxury in Dubai with 5-star accommodations, private tours, and exclusive experiences.", inclusions: [ "5-star hotel accommodation", "Private city tours", "Desert safari experience", "Burj Khalifa tickets", "Airport transfers", ], }; const mockTourPurchases: TourPurchase[] = [ { id: 1, userName: "Aziza Karimova", userPhone: "+998 90 123 45 67", tourName: "Dubai Luxury Tour", tourId: 1, agencyName: "Silk Road Travel", agencyId: 1, destination: "Dubai, UAE", travelDate: "2025-11-10", amount: 1500000, paymentStatus: "paid", purchaseDate: "2025-10-10", rating: 5, review: "Amazing experience! The hotel was luxurious and the tours were well organized.", }, { id: 2, userName: "Sardor Rahimov", userPhone: "+998 91 234 56 78", tourName: "Dubai Luxury Tour", tourId: 1, agencyName: "Silk Road Travel", agencyId: 1, destination: "Dubai, UAE", travelDate: "2025-11-15", amount: 1500000, paymentStatus: "paid", purchaseDate: "2025-10-12", rating: 4, review: "Great tour overall. The desert safari was the highlight of our trip.", }, { id: 3, userName: "Nilufar Toshmatova", userPhone: "+998 93 345 67 89", tourName: "Dubai Luxury Tour", tourId: 1, agencyName: "Silk Road Travel", agencyId: 1, destination: "Dubai, UAE", travelDate: "2025-11-20", amount: 1500000, paymentStatus: "pending", purchaseDate: "2025-10-14", rating: 0, review: "", }, ]; export default function FinanceDetailTour() { const [activeTab, setActiveTab] = useState< "overview" | "bookings" | "reviews" >("overview"); const getStatusBadge = (status: TourPurchase["paymentStatus"]) => { const base = "px-3 py-1 rounded-full text-sm font-medium inline-flex items-center gap-2"; switch (status) { case "paid": return ( Paid ); case "pending": return ( Pending ); case "cancelled": return ( Cancelled ); case "refunded": return ( Refunded ); } }; const renderStars = (rating: number) => { return (
Financial performance for {mockTourData.name}
Total Revenue
${(totalRevenue / 1000000).toFixed(1)}M
From completed bookings
Pending Revenue
${(pendingRevenue / 1000000).toFixed(1)}M
Awaiting payment
Total Bookings
{mockTourPurchases.length}
All bookings
Average Rating
{mockTourData.averageRating}/5
Customer satisfaction
Tour Name
{mockTourData.name}
Destination
{mockTourData.destination}
Duration
{mockTourData.duration}
Agency
{mockTourData.agency}
Description
{mockTourData.description}
Base Price
${(mockTourData.price / 1000000).toFixed(1)}M
per person
{purchase.userPhone}
Travel Date
{purchase.travelDate}
Booking Date
{purchase.purchaseDate}
Amount
${(purchase.amount / 1000000).toFixed(1)}M
{purchase.travelDate}
{purchase.review}