|
| 1 | +'use client' |
| 2 | + |
| 3 | +import { Button } from '@/components/ui/button' |
| 4 | +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' |
| 5 | +import { MoreHorizontal } from 'lucide-react' |
| 6 | + |
| 7 | +export default function TaskLoading() { |
| 8 | + |
| 9 | + const loadingActions = ( |
| 10 | + <div className="flex items-center gap-2"> |
| 11 | + {/* Deploy to Vercel Button */} |
| 12 | + <Button |
| 13 | + asChild |
| 14 | + variant="outline" |
| 15 | + size="sm" |
| 16 | + className="h-8 px-3 text-xs bg-black text-white border-black hover:bg-black/90 dark:bg-white dark:text-black dark:border-white dark:hover:bg-white/90" |
| 17 | + > |
| 18 | + <a |
| 19 | + href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FGerome-Elassaad%2Fcodingit" |
| 20 | + target="_blank" |
| 21 | + rel="noopener noreferrer" |
| 22 | + className="flex items-center gap-1.5" |
| 23 | + > |
| 24 | + <svg viewBox="0 0 76 65" className="h-3 w-3" fill="currentColor"> |
| 25 | + <path d="M37.5274 0L75.0548 65H0L37.5274 0Z" /> |
| 26 | + </svg> |
| 27 | + Deploy to Vercel |
| 28 | + </a> |
| 29 | + </Button> |
| 30 | + |
| 31 | + {/* More Actions Menu Placeholder */} |
| 32 | + <Button variant="ghost" size="sm" className="h-8 w-8 p-0" disabled> |
| 33 | + <MoreHorizontal className="h-4 w-4" /> |
| 34 | + </Button> |
| 35 | + </div> |
| 36 | + ) |
| 37 | + |
| 38 | + return ( |
| 39 | + <div className="flex-1 bg-background"> |
| 40 | + <div className="mx-auto p-3"> |
| 41 | + <div className="max-w-4xl mx-auto"> |
| 42 | + <div className="grid grid-cols-1 lg:grid-cols-2 gap-6"> |
| 43 | + {/* Task Info Skeleton */} |
| 44 | + <Card> |
| 45 | + <CardHeader> |
| 46 | + <CardTitle className="flex items-center justify-between"> |
| 47 | + <div className="h-6 bg-muted animate-pulse rounded w-24"></div> |
| 48 | + <div className="h-6 bg-muted animate-pulse rounded w-16"></div> |
| 49 | + </CardTitle> |
| 50 | + </CardHeader> |
| 51 | + <CardContent className="space-y-4"> |
| 52 | + <div className="space-y-2"> |
| 53 | + <div className="h-4 bg-muted animate-pulse rounded w-16"></div> |
| 54 | + <div className="h-16 bg-muted animate-pulse rounded"></div> |
| 55 | + </div> |
| 56 | + <div className="space-y-2"> |
| 57 | + <div className="h-4 bg-muted animate-pulse rounded w-20"></div> |
| 58 | + <div className="h-4 bg-muted animate-pulse rounded w-48"></div> |
| 59 | + </div> |
| 60 | + <div className="space-y-2"> |
| 61 | + <div className="h-4 bg-muted animate-pulse rounded w-12"></div> |
| 62 | + <div className="flex items-center gap-2"> |
| 63 | + <div className="h-4 w-4 bg-muted animate-pulse rounded"></div> |
| 64 | + <div className="h-4 bg-muted animate-pulse rounded w-24"></div> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + </CardContent> |
| 68 | + </Card> |
| 69 | + |
| 70 | + {/* Logs Skeleton */} |
| 71 | + <Card> |
| 72 | + <CardHeader> |
| 73 | + <CardTitle className="flex items-center justify-between"> |
| 74 | + <div className="h-6 bg-muted animate-pulse rounded w-20"></div> |
| 75 | + <div className="h-8 bg-muted animate-pulse rounded w-16"></div> |
| 76 | + </CardTitle> |
| 77 | + </CardHeader> |
| 78 | + <CardContent> |
| 79 | + <div className="space-y-3 h-96 overflow-hidden"> |
| 80 | + {Array.from({ length: 8 }).map((_, i) => { |
| 81 | + const widths = ['75%', '85%', '65%', '90%', '70%', '80%', '95%', '60%'] |
| 82 | + return ( |
| 83 | + <div key={i} className="flex gap-2"> |
| 84 | + <div className="h-4 w-12 bg-muted animate-pulse rounded flex-shrink-0"></div> |
| 85 | + <div className="h-4 bg-muted animate-pulse rounded flex-1" style={{ width: widths[i] }}></div> |
| 86 | + </div> |
| 87 | + ) |
| 88 | + })} |
| 89 | + </div> |
| 90 | + </CardContent> |
| 91 | + </Card> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </div> |
| 96 | + ) |
| 97 | +} |
0 commit comments