|
| 1 | +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' |
| 2 | +import { Button } from '@/components/ui/button' |
| 3 | + |
| 4 | +export default async function StackDetailPage({ params }: { params: Promise<{ slug: string }> }) { |
| 5 | + const { slug } = await params |
| 6 | + // Mock data for demonstration |
| 7 | + const stack = { |
| 8 | + name: 'Modern Web Stack', |
| 9 | + description: 'A comprehensive full-stack web development setup with React and Node.js', |
| 10 | + creator: 'TechCorp', |
| 11 | + favCount: 42, |
| 12 | + technologies: [ |
| 13 | + { id: 1, name: 'React', tier: 'Frontend Library' }, |
| 14 | + { id: 2, name: 'Next.js', tier: 'Frontend Framework' }, |
| 15 | + { id: 3, name: 'TypeScript', tier: 'Programming Language' }, |
| 16 | + { id: 4, name: 'Node.js', tier: 'Runtime' }, |
| 17 | + { id: 5, name: 'PostgreSQL', tier: 'Database' }, |
| 18 | + { id: 6, name: 'Tailwind CSS', tier: 'CSS Framework' }, |
| 19 | + { id: 7, name: 'Vercel', tier: 'Hosting' }, |
| 20 | + { id: 8, name: 'GitHub Actions', tier: 'CI/CD' }, |
| 21 | + ], |
| 22 | + } |
| 23 | + |
| 24 | + return ( |
| 25 | + <div className="container py-8"> |
| 26 | + <div className="mb-8"> |
| 27 | + <div className="flex items-start justify-between"> |
| 28 | + <div> |
| 29 | + <h1 className="text-4xl font-bold tracking-tight">{stack.name}</h1> |
| 30 | + <p className="text-lg text-muted-foreground mt-2"> |
| 31 | + by {stack.creator} |
| 32 | + </p> |
| 33 | + </div> |
| 34 | + <Button size="lg">❤️ Favorite</Button> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + |
| 38 | + <div className="grid gap-8 lg:grid-cols-3"> |
| 39 | + <div className="lg:col-span-2"> |
| 40 | + <Card className="mb-8"> |
| 41 | + <CardHeader> |
| 42 | + <CardTitle>About This Stack</CardTitle> |
| 43 | + </CardHeader> |
| 44 | + <CardContent> |
| 45 | + <p className="text-muted-foreground">{stack.description}</p> |
| 46 | + </CardContent> |
| 47 | + </Card> |
| 48 | + |
| 49 | + <div> |
| 50 | + <h2 className="text-2xl font-bold mb-4">Technology Stack</h2> |
| 51 | + <div className="grid gap-4 sm:grid-cols-2"> |
| 52 | + {stack.technologies.map((tech) => ( |
| 53 | + <Card key={tech.id} className="hover:shadow-md transition-shadow"> |
| 54 | + <CardHeader> |
| 55 | + <CardTitle className="text-lg">{tech.name}</CardTitle> |
| 56 | + <CardDescription>{tech.tier}</CardDescription> |
| 57 | + </CardHeader> |
| 58 | + </Card> |
| 59 | + ))} |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + |
| 64 | + <div> |
| 65 | + <Card> |
| 66 | + <CardHeader> |
| 67 | + <CardTitle>Stats</CardTitle> |
| 68 | + </CardHeader> |
| 69 | + <CardContent className="space-y-4"> |
| 70 | + <div> |
| 71 | + <div className="text-2xl font-bold">{stack.favCount}</div> |
| 72 | + <div className="text-sm text-muted-foreground">Favorites</div> |
| 73 | + </div> |
| 74 | + <div> |
| 75 | + <div className="text-2xl font-bold">{stack.technologies.length}</div> |
| 76 | + <div className="text-sm text-muted-foreground">Technologies</div> |
| 77 | + </div> |
| 78 | + </CardContent> |
| 79 | + </Card> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + </div> |
| 83 | + ) |
| 84 | +} |
0 commit comments