From 37d7a664e0141365ee851575f0286480d39565f1 Mon Sep 17 00:00:00 2001 From: "santasri.pachhal" Date: Thu, 19 Mar 2026 12:29:50 +0530 Subject: [PATCH] refactor: upload section design fix --- src/app/(modules)/results/[videoId]/page.tsx | 14 ++++++-- src/app/(modules)/upload/[videoId]/page.tsx | 14 ++++++-- src/app/(modules)/upload/page.tsx | 14 ++++++-- src/components/project-selection-section.tsx | 34 ++++++++++++++++---- src/types/session.ts | 2 ++ 5 files changed, 65 insertions(+), 13 deletions(-) diff --git a/src/app/(modules)/results/[videoId]/page.tsx b/src/app/(modules)/results/[videoId]/page.tsx index 24fb584..2a5f4f2 100644 --- a/src/app/(modules)/results/[videoId]/page.tsx +++ b/src/app/(modules)/results/[videoId]/page.tsx @@ -3,7 +3,7 @@ import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import { Button } from '@/components/ui/button'; -import { Loader2, TrendingUp } from 'lucide-react'; +import { Loader2, TrendingUp, ArrowUp, ArrowDown } from 'lucide-react'; import VideoPlayerSection from '@/components/video-player-section'; import { PageHeader } from '@/components/page-header'; import { PoweredBy } from '@/components/powered-by'; @@ -145,8 +145,18 @@ export default function VideoResultsPage() { Chainage - + {session.chainageName} + {session.chainageDirection && ( + + {session.chainageDirection === 'UP' ? ( + + ) : ( + + )} + {session.chainageDirection} + + )} diff --git a/src/app/(modules)/upload/[videoId]/page.tsx b/src/app/(modules)/upload/[videoId]/page.tsx index 2e7f650..fd2190e 100644 --- a/src/app/(modules)/upload/[videoId]/page.tsx +++ b/src/app/(modules)/upload/[videoId]/page.tsx @@ -3,7 +3,7 @@ import { useState, useEffect, useCallback } from 'react'; import { useRouter, useParams } from 'next/navigation'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; -import { Loader2, TrendingUp } from 'lucide-react'; +import { Loader2, TrendingUp, ArrowUp, ArrowDown } from 'lucide-react'; import { PageHeader } from '@/components/page-header'; import { PoweredBy } from '@/components/powered-by'; import { sessionService, videoService } from '@/services/api'; @@ -151,8 +151,18 @@ export default function VideoProcessingPage() { Chainage - + {session.chainageName} + {session.chainageDirection && ( + + {session.chainageDirection === 'UP' ? ( + + ) : ( + + )} + {session.chainageDirection} + + )} diff --git a/src/app/(modules)/upload/page.tsx b/src/app/(modules)/upload/page.tsx index 550bb77..c79fe02 100644 --- a/src/app/(modules)/upload/page.tsx +++ b/src/app/(modules)/upload/page.tsx @@ -13,7 +13,7 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; -import { Loader2, TrendingUp } from 'lucide-react'; +import { Loader2, TrendingUp, ArrowUp, ArrowDown } from 'lucide-react'; import { PageHeader } from '@/components/page-header'; import { PoweredBy } from '@/components/powered-by'; import { sessionService, videoService } from '@/services/api'; @@ -167,13 +167,23 @@ export default function UploadPage() { {item.value} + {item.label === 'Chainage' && session.chainageDirection && ( + + {session.chainageDirection === 'UP' ? ( + + ) : ( + + )} + {session.chainageDirection} + + )} ))} diff --git a/src/components/project-selection-section.tsx b/src/components/project-selection-section.tsx index bf4f77f..b3ac218 100644 --- a/src/components/project-selection-section.tsx +++ b/src/components/project-selection-section.tsx @@ -11,7 +11,7 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; -import { Loader2, Check } from 'lucide-react'; +import { Loader2, Check, ArrowUp, ArrowDown } from 'lucide-react'; import { projectService, packageService, chainageService } from '@/services/api'; import { Project, Package as PackageType, Chainage, SessionContext } from '@/types'; import { cn } from '@/lib/utils'; @@ -133,6 +133,7 @@ export function ProjectSelectionSection({ onSelectionComplete }: ProjectSelectio packageName: selectedPackage.name, chainageId: selectedChainage.id, chainageName: selectedChainage.segment_name, + chainageDirection: selectedChainage.direction, }); } }; @@ -298,11 +299,20 @@ export function ProjectSelectionSection({ onSelectionComplete }: ProjectSelectio {chainages.map((chn) => ( -
- {chn.segment_name} - - {chn.chainage_start_km}-{chn.chainage_end_km} km | {chn.direction} - +
+ {chn.segment_name} +
+ {chn.chainage_start_km}-{chn.chainage_end_km} km + + + {chn.direction === 'UP' ? ( + + ) : ( + + )} + {chn.direction} + +
))} @@ -320,7 +330,17 @@ export function ProjectSelectionSection({ onSelectionComplete }: ProjectSelectio / {selectedPackage?.name} / - {selectedChainage?.segment_name} + + {selectedChainage?.segment_name} + + {selectedChainage?.direction === 'UP' ? ( + + ) : ( + + )} + {selectedChainage?.direction} + +
)} diff --git a/src/types/session.ts b/src/types/session.ts index 1c7b23a..6a5c1b5 100644 --- a/src/types/session.ts +++ b/src/types/session.ts @@ -8,6 +8,7 @@ export interface SessionContext { packageName: string | null; chainageId: string | null; chainageName: string | null; + chainageDirection?: string | null; } export const emptySessionContext: SessionContext = { @@ -17,4 +18,5 @@ export const emptySessionContext: SessionContext = { packageName: null, chainageId: null, chainageName: null, + chainageDirection: null, };