pages/fleet.tsx
The main entry point for the Fleet Dashboard. This Next.js page renders at the/fleet route and serves as the container for the entire Fleet Management module.
Purpose
- Serves as the route handler for
/fleet - Sets up page metadata (title, description) via Next.js
Head - Provides navigation callback handlers to child components
- Renders the
FleetManagementwrapper component
File Location
FleetManagementPage
The default exported React component that Next.js renders for the/fleet route.
Function Signature
Dependencies
| Import | Source | Purpose |
|---|---|---|
React, useCallback | react | React hooks for memoization |
Head | next/head | SEO and page metadata |
useRouter | next/router | Programmatic navigation |
FleetManagement | @/components/FleetManagement | Main fleet UI component |
Implementation
Navigation Callbacks
The page defines two memoized callback functions that are passed to theFleetManagement component:
handleNavigateToTracking
handleNavigateToTracking
handleNavigateToTractor
handleNavigateToTractor
Page Metadata
TheHead component sets the following metadata for SEO and browser display:
| Property | Value |
|---|---|
<title> | ”Fleet Management Overview - Hemut Transportation Management” |
<meta name="description"> | ”Fleet Management Overview Dashboard” |
Component Hierarchy
The page component sits at the top of the Dashboard’s component tree:The
FleetManagement component handles routing between different fleet modules (Dashboard, Drivers, Tractors, Trailers, PTA) based on the current URL path.Related Pages
Other Fleet Management routes follow the same pattern:| Route | Page File | Rendered Component |
|---|---|---|
/fleet | pages/fleet.tsx | UnifiedFleetDashboard |
/fleet/drivers | pages/fleet/drivers.tsx | DriverManagement |
/fleet/tractors | pages/fleet/tractors.tsx | TractorManagement |
/fleet/trailers | pages/fleet/trailers.tsx | TrailerManagement |
/fleet/pta | pages/fleet/pta.tsx | PredictedTimeAvailable |
All fleet routes share the same
FleetManagement wrapper component, which provides consistent navigation between modules.
