From ee761ebb2986519fd9dd546526ec1b3fc5608bb0 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 05:31:46 +0000 Subject: [PATCH 1/2] Add src/app/dashboard/page.tsx --- src/app/dashboard/page.tsx | 208 +++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 src/app/dashboard/page.tsx diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx new file mode 100644 index 0000000..eaa5c98 --- /dev/null +++ b/src/app/dashboard/page.tsx @@ -0,0 +1,208 @@ +"use client"; + +import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloatingInline'; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import { BarChart3, TrendingUp, Truck, AlertCircle, Clock, MapPin, Users, Activity } from 'lucide-react'; +import { useState } from 'react'; + +export default function DashboardPage() { + const [selectedLoad, setSelectedLoad] = useState(null); + + const loads = [ + { + id: "LOAD-001", origin: "Los Angeles, CA", destination: "Las Vegas, NV", status: "in-transit", driver: "John Smith", distance: "270 miles", eta: "2:30 PM", progress: 65, + vehicle: "Truck #12" + }, + { + id: "LOAD-002", origin: "Phoenix, AZ", destination: "Denver, CO", status: "dispatched", driver: "Sarah Johnson", distance: "600 miles", eta: "Next Day", progress: 0, + vehicle: "Truck #8" + }, + { + id: "LOAD-003", origin: "Denver, CO", destination: "Chicago, IL", status: "delivered", driver: "Mike Chen", distance: "1000 miles", eta: "Completed", progress: 100, + vehicle: "Truck #15" + }, + { + id: "LOAD-004", origin: "Dallas, TX", destination: "Houston, TX", status: "in-transit", driver: "Emma Wilson", distance: "240 miles", eta: "1:15 PM", progress: 45, + vehicle: "Truck #5" + }, + { + id: "LOAD-005", origin: "Portland, OR", destination: "Seattle, WA", status: "pending", driver: "Unassigned", distance: "170 miles", eta: "Pending Assignment", progress: 0, + vehicle: "Available" + }, + ]; + + const metrics = [ + { icon: Truck, label: "Active Loads", value: "12", color: "bg-blue-500" }, + { icon: TrendingUp, label: "Completed Today", value: "8", color: "bg-green-500" }, + { icon: Clock, label: "Avg Delivery Time", value: "2.3h", color: "bg-purple-500" }, + { icon: AlertCircle, label: "Delays", value: "1", color: "bg-red-500" }, + ]; + + const getStatusColor = (status: string) => { + switch (status) { + case "in-transit": + return "bg-blue-100 text-blue-700"; + case "delivered": + return "bg-green-100 text-green-700"; + case "dispatched": + return "bg-yellow-100 text-yellow-700"; + case "pending": + return "bg-gray-100 text-gray-700"; + default: + return "bg-gray-100 text-gray-700"; + } + }; + + const getStatusLabel = (status: string) => { + return status.charAt(0).toUpperCase() + status.slice(1).replace("-", " "); + }; + + return ( + + + +
+
+ {/* Header */} +
+

Fleet Dashboard

+

Track and manage all active loads and dispatcher operations

+
+ + {/* Metrics Grid */} +
+ {metrics.map((metric, idx) => { + const Icon = metric.icon; + return ( +
+
+
+ +
+
+

{metric.label}

+

{metric.value}

+
+ ); + })} +
+ + {/* Loads Section */} +
+
+

+ + Active Loads & Dispatcher Management +

+
+ +
+ + + + + + + + + + + + + + {loads.map((load) => ( + setSelectedLoad(selectedLoad === load.id ? null : load.id)} + className="border-b border-accent/10 hover:bg-background/30 cursor-pointer transition-colors" + > + + + + + + + + + ))} + +
Load IDRouteDriverVehicleStatusProgressETA
{load.id} +
+ + {load.origin} → {load.destination} +
+
{load.driver}{load.vehicle} + + {getStatusLabel(load.status)} + + +
+
+
+ {load.progress}% +
{load.eta}
+
+
+ + {/* Selected Load Details */} + {selectedLoad && ( +
+

Load Details: {selectedLoad}

+ {loads + .filter((load) => load.id === selectedLoad) + .map((load) => ( +
+
+

Origin

+

{load.origin}

+

Driver

+

{load.driver}

+

Distance

+

{load.distance}

+
+
+

Destination

+

{load.destination}

+

Vehicle

+

{load.vehicle}

+

ETA

+

{load.eta}

+
+
+ ))} +
+ )} +
+
+
+ ); +} -- 2.49.1 From a092d2837098f8544f5a52bb6a9b16fcf4b05b31 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 05:31:46 +0000 Subject: [PATCH 2/2] Update src/app/page.tsx --- src/app/page.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/page.tsx b/src/app/page.tsx index 5ecceb1..7d3ccae 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -34,6 +34,7 @@ export default function LandingPage() { { name: "Features", id: "features" }, { name: "Pricing", id: "pricing" }, { name: "About", id: "about" }, + { name: "Dashboard", id: "/dashboard" }, { name: "Contact", id: "contact" } ]} button={{ -- 2.49.1