page.tsx58 lines, 2.1 KB
| 1 | "use client"; |
| 2 | |
| 3 | import { useVideoProcessingStatus } from "@/lib/hooks/queries/video"; |
| 4 | import VideoSubmissionForm from "./components/video-submission-form"; |
| 5 | import { Loader2 } from "lucide-react"; |
| 6 | import { cn } from "@/lib/utils"; |
| 7 | |
| 8 | export default function DashboardPage() { |
| 9 | const { data: processingStatus } = useVideoProcessingStatus(); |
| 10 | |
| 11 | return ( |
| 12 | <div className="space-y-8"> |
| 13 | {processingStatus?.isProcessing && ( |
| 14 | <div |
| 15 | className={cn( |
| 16 | "relative px-4 py-3 transition-all duration-500 rounded-lg", |
| 17 | "bg-blue-500/10 border border-blue-500/20" |
| 18 | )} |
| 19 | > |
| 20 | <div className="flex items-center gap-4 max-w-7xl mx-auto"> |
| 21 | <div className="flex-shrink-0"> |
| 22 | <div className="rounded-full bg-blue-500/15 p-1"> |
| 23 | <Loader2 className="size-5 text-blue-600 animate-spin" /> |
| 24 | </div> |
| 25 | </div> |
| 26 | <div className="flex-1 flex items-center justify-between gap-4 min-w-0"> |
| 27 | <div className="flex-1"> |
| 28 | <p className="text-sm font-medium text-blue-600"> |
| 29 | Processing video in progress |
| 30 | {processingStatus.progress && |
| 31 | ` (${processingStatus.progress})%`} |
| 32 | </p> |
| 33 | <p className="text-sm text-muted-foreground"> |
| 34 | Currently analyzing "{processingStatus.videoTitle}". |
| 35 | This may take a few minutes depending on the video length. |
| 36 | </p> |
| 37 | </div> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | )} |
| 42 | <div className="space-y-2"> |
| 43 | <h1 className="text-3xl font-bold tracking-tight">Submit New Video</h1> |
| 44 | <p className="text-lg text-muted-foreground max-w-3xl"> |
| 45 | Enter a YouTube URL to get started with AI-powered video |
| 46 | summarization. Our advanced AI will analyze your video and provide |
| 47 | comprehensive insights. |
| 48 | </p> |
| 49 | </div> |
| 50 | |
| 51 | <div className="grid gap-8 lg:grid-cols-[2fr,1fr]"> |
| 52 | <div className="space-y-6"> |
| 53 | <VideoSubmissionForm /> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | ); |
| 58 | } |