/** * Dashboard Home Page * * Main dashboard with KPIs and recent bookings */ 'use client'; import { useQuery } from '@tanstack/react-query'; import { bookingsApi } from '@/lib/api'; import Link from 'next/link'; export default function DashboardPage() { const { data: bookings, isLoading } = useQuery({ queryKey: ['bookings', 'recent'], queryFn: () => bookingsApi.list({ limit: 5 }), }); const stats = [ { name: 'Total Bookings', value: bookings?.total || 0, icon: '📦', change: '+12%' }, { name: 'This Month', value: '8', icon: '📅', change: '+4.3%' }, { name: 'Pending', value: '3', icon: '⏳', change: '-2%' }, { name: 'Completed', value: '45', icon: '✅', change: '+8%' }, ]; return (
Here's what's happening with your shipments today.
{stat.name}
{stat.value}
Find the best shipping rates
Create a new shipment
Track all your shipments
{booking.cargoDescription}
{new Date(booking.createdAt).toLocaleDateString()}
No bookings yet
Search for rates