Skip to content

Commit 55bb498

Browse files
author
Gerome El-assaad
committed
Add task page route and components
1 parent d26872d commit 55bb498

3 files changed

Lines changed: 132 additions & 0 deletions

File tree

app/[taskId]/loading.tsx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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+
}

app/[taskId]/not-found.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { AlertCircle } from 'lucide-react'
2+
3+
export default function TaskNotFound() {
4+
return (
5+
<div className="flex-1 bg-background flex items-center justify-center">
6+
<div className="text-center max-w-md mx-auto px-4">
7+
<AlertCircle className="h-16 w-16 text-muted-foreground mx-auto mb-4" />
8+
<h1 className="text-2xl font-bold mb-2">Task Not Found</h1>
9+
<p className="text-muted-foreground">The task you're looking for doesn't exist or may have been deleted.</p>
10+
</div>
11+
</div>
12+
)
13+
}

app/[taskId]/page.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { TaskPageClient } from '@/components/task-page-client'
2+
3+
interface TaskPageProps {
4+
params: {
5+
taskId: string
6+
}
7+
}
8+
9+
export default async function TaskPage({ params }: TaskPageProps) {
10+
const { taskId } = await params
11+
12+
return <TaskPageClient taskId={taskId} />
13+
}
14+
15+
export async function generateMetadata({ params }: TaskPageProps) {
16+
const { taskId } = await params
17+
18+
return {
19+
title: `Task - Coding Agent Platform`,
20+
description: 'View task details and execution logs',
21+
}
22+
}

0 commit comments

Comments
 (0)