diff --git a/app/create-location/page.tsx b/app/create-location/page.tsx index 7ca5669..9bc1640 100644 --- a/app/create-location/page.tsx +++ b/app/create-location/page.tsx @@ -192,20 +192,46 @@ export default function CreateLocationPage() { header: "Package", render: (location: Location) => getPackageName(location.package_id) }, + { + key: "project", + header: "Project", + render: (location: Location) => { + const pkg = allPackages.find(p => p.id === location.package_id) + const project = projects.find(p => p.id === pkg?.project_id) + return project?.name || "—" + } + }, { key: "chainage", header: "Chainage (km)", render: (location: Location) => { - if (location.chainage_start_km && location.chainage_end_km) { - return `${location.chainage_start_km} - ${location.chainage_end_km}` + if (location.chainage_start_km !== null && location.chainage_end_km !== null) { + return ( + + {location.chainage_start_km} - {location.chainage_end_km} + + ) } return "—" } }, { - key: "created_at", - header: "Created", - render: (location: Location) => new Date(location.created_at).toLocaleDateString() + key: "start_gps", + header: "Start GPS", + render: (location: Location) => ( + + {location.start_lat.toFixed(4)}, {location.start_lng.toFixed(4)} + + ) + }, + { + key: "end_gps", + header: "End GPS", + render: (location: Location) => ( + + {location.end_lat.toFixed(4)}, {location.end_lng.toFixed(4)} + + ) }, ] @@ -213,16 +239,16 @@ export default function CreateLocationPage() {
-
- {/* Header */} +
+ {/* Refined Header */}
-
-
- +
+
+
-

- Locations +

+ Location Management

Manage road segment locations @@ -267,7 +293,7 @@ export default function CreateLocationPage() { - + Create New Location @@ -277,9 +303,9 @@ export default function CreateLocationPage() { {/* Success Message in Modal */} {success && ( -

- -

Location created successfully!

+
+ +

Location created successfully!

)} @@ -295,18 +321,18 @@ export default function CreateLocationPage() {
{/* Step 1: Select Project */} -
+
-
+
1
-

Select Project

+

Select Project

{selectedProject && ( -
+
Selected: {selectedProject.name}
)}
{/* Step 2: Select Package */} -
+
-
+
2
-

Select Package

+

Select Package

{selectedPackage && ( -
+
Selected: {selectedPackage.name} {selectedPackage.region && ` • ${selectedPackage.region}`}
@@ -368,7 +394,7 @@ export default function CreateLocationPage() { {/* Step 3: Location Details */}
-
+
3

Location Information

@@ -428,7 +454,7 @@ export default function CreateLocationPage() { {/* GPS Coordinates */}
-
+

GPS Coordinates

@@ -436,8 +462,8 @@ export default function CreateLocationPage() {
{/* Start Point */} -
-

Start Point

+
+

Start Point

@@ -469,8 +495,8 @@ export default function CreateLocationPage() {
{/* End Point */} -
-

End Point

+
+

End Point

@@ -520,7 +546,7 @@ export default function CreateLocationPage() { - -
)} diff --git a/app/upload/page.tsx b/app/upload/page.tsx index 4b2b1bd..96294e5 100644 --- a/app/upload/page.tsx +++ b/app/upload/page.tsx @@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" -import { Loader2 } from "lucide-react" +import { Loader2, TrendingUp } from "lucide-react" import { SidebarNavigation } from "@/components/sidebar-navigation" import { type SessionContext, @@ -174,10 +174,13 @@ export default function UploadPage() { {/* Main Content */}
-
- {/* Compact Header */} -
-
+
+ {/* Refined Header */} +
+
+ +
+

{getTitle()}

@@ -189,20 +192,24 @@ export default function UploadPage() {
-
-
-

Project

-

{session.projectName}

+
+
+ Project + + {session.projectName} +
-
-
-

Package

-

{session.packageName}

+
+ Package + + {session.packageName} +
-
-
-

Location

-

{session.locationName}

+
+ Location + + {session.locationName} +
{/* JSON File Input */} @@ -274,14 +273,6 @@ export default function UploadPage() { disabled={uploading} className="h-10 bg-gray-50 dark:bg-gray-800 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:bg-indigo-100 dark:file:bg-indigo-900/50 file:text-indigo-600 dark:file:text-indigo-400 file:font-medium file:text-xs hover:file:bg-indigo-200" /> - {jsonFile && ( -
-

{jsonFile.name}

-

- {(jsonFile.size / 1024).toFixed(2)} KB -

-
- )}
{/* Detection Type */} diff --git a/components/dashboard/compact-project-selector.tsx b/components/dashboard/compact-project-selector.tsx index f444159..2807d6b 100644 --- a/components/dashboard/compact-project-selector.tsx +++ b/components/dashboard/compact-project-selector.tsx @@ -28,16 +28,14 @@ export function CompactProjectSelector({ return (
{/* Project Dropdown */} -
-
- -
+
+ Project