Final working front

This commit is contained in:
Suman991
2026-01-29 14:27:57 +05:30
parent a83545d1db
commit 93c1d763b5
4 changed files with 165 additions and 35 deletions

View File

@@ -65,6 +65,7 @@ export type DetectionData = {
export default function DetectionPage() {
const [detectionData, setDetectionData] = useState<DetectionData | null>(null)
const [videoId, setVideoId] = useState<string | null>(null)
const [videoFile, setVideoFile] = useState<File | null>(null)
const [detectionType, setDetectionType] = useState<DetectionType>("pothole-detection")
const getTitle = () => {
@@ -93,20 +94,22 @@ export default function DetectionPage() {
{/* Upload Section */}
<div className="animate-in fade-in slide-in-from-bottom duration-700 delay-100">
<UploadSection
onDetectionComplete={(data, vId) => {
onDetectionComplete={(data, vId, file) => {
setDetectionData(data)
setVideoId(vId)
setVideoFile(file)
}}
onDetectionTypeChange={setDetectionType}
/>
</div>
{/* Video Player Section */}
{detectionData && videoId && (
{detectionData && videoId && videoFile && (
<div className="mt-6 animate-in fade-in slide-in-from-bottom duration-700 delay-200">
<VideoPlayerSection
data={detectionData}
videoId={videoId}
videoFile={videoFile}
detectionType={detectionType}
/>
</div>