({ videoInfo, preview }: LoadingContextProps)
| 11 | } |
| 12 | |
| 13 | export function LoadingContext({ videoInfo, preview }: LoadingContextProps) { |
| 14 | return ( |
| 15 | <div className="max-w-2xl mx-auto space-y-6"> |
| 16 | {/* Video Info Card */} |
| 17 | {videoInfo ? ( |
| 18 | <Card className="p-6"> |
| 19 | <div className="flex gap-6"> |
| 20 | {/* Thumbnail */} |
| 21 | <div className="flex-shrink-0"> |
| 22 | {/* eslint-disable-next-line @next/next/no-img-element */} |
| 23 | <img |
| 24 | src={videoInfo.thumbnail} |
| 25 | alt={videoInfo.title} |
| 26 | className="w-48 h-27 object-cover rounded-md" |
| 27 | /> |
| 28 | </div> |
| 29 | |
| 30 | {/* Video Details */} |
| 31 | <div className="flex-1 space-y-3"> |
| 32 | <h3 className="text-lg font-semibold line-clamp-2"> |
| 33 | {videoInfo.title} |
| 34 | </h3> |
| 35 | |
| 36 | <div className="flex items-center gap-4 text-sm text-muted-foreground"> |
| 37 | <div className="flex items-center gap-1"> |
| 38 | <User className="w-4 h-4" /> |
| 39 | <span>{videoInfo.author}</span> |
| 40 | </div> |
| 41 | {videoInfo.duration && ( |
| 42 | <div className="flex items-center gap-1"> |
| 43 | <Clock className="w-4 h-4" /> |
| 44 | <span>{Math.floor(videoInfo.duration / 60)} min</span> |
| 45 | </div> |
| 46 | )} |
| 47 | </div> |
| 48 | |
| 49 | {/* Quick Preview */} |
| 50 | {preview && preview !== 'Processing video content...' && ( |
| 51 | <div className="pt-2"> |
| 52 | <p className="text-sm text-muted-foreground leading-relaxed"> |
| 53 | {preview} |
| 54 | </p> |
| 55 | </div> |
| 56 | )} |
| 57 | </div> |
| 58 | </div> |
| 59 | </Card> |
| 60 | ) : ( |
| 61 | <Card className="p-6"> |
| 62 | <div className="flex gap-6"> |
| 63 | <Skeleton className="w-48 h-27 rounded-md" /> |
| 64 | <div className="flex-1 space-y-3"> |
| 65 | <Skeleton className="h-6 w-3/4" /> |
| 66 | <Skeleton className="h-4 w-1/2" /> |
| 67 | {/* Show preview even without video info */} |
| 68 | {preview && preview !== 'Processing video content...' ? ( |
| 69 | <div className="pt-2"> |
| 70 | <p className="text-sm text-muted-foreground leading-relaxed"> |
nothing calls this directly
no outgoing calls
no test coverage detected