|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import Link from "next/link"; |
| 4 | +import { Icon, faCode, faLayerGroup, faTerminal, faDesktop, faListCheck, faArrowsToCircle, faArrowRight, faDatabase } from "@rivet-gg/icons"; |
| 5 | + |
| 6 | +// Tutorials section |
| 7 | +export const TutorialsSection = () => { |
| 8 | + const tutorials = [ |
| 9 | + { |
| 10 | + title: "Deploy your first function", |
| 11 | + description: "Get started with serverless functions in minutes", |
| 12 | + icons: [faCode], |
| 13 | + href: "/docs/tutorials/first-function", |
| 14 | + useCases: ["APIs", "Webhooks", "Edge computing"] |
| 15 | + }, |
| 16 | + { |
| 17 | + title: "Create a stateful actor", |
| 18 | + description: "Build services that maintain state between requests", |
| 19 | + icons: [faLayerGroup], |
| 20 | + href: "/docs/tutorials/stateful-actor", |
| 21 | + useCases: ["AI agents", "Stateful workers", "Long-running processes"] |
| 22 | + }, |
| 23 | + { |
| 24 | + title: "Build a workflow", |
| 25 | + description: "Orchestrate complex multi-step processes", |
| 26 | + icons: [faArrowsToCircle], |
| 27 | + href: "/docs/tutorials/workflows", |
| 28 | + useCases: ["Multi-agent systems", "Business logic", "ETL pipelines"] |
| 29 | + }, |
| 30 | + { |
| 31 | + title: "Run AI generated code in a sandbox", |
| 32 | + description: "Execute untrusted code safely with isolation", |
| 33 | + icons: [faTerminal], |
| 34 | + href: "/docs/tutorials/ai-sandbox", |
| 35 | + useCases: ["LLM code execution", "User code execution", "AI agents"] |
| 36 | + }, |
| 37 | + { |
| 38 | + title: "Access desktop sandbox", |
| 39 | + description: "Run GUI applications in an isolated environment", |
| 40 | + icons: [faDesktop], |
| 41 | + href: "/docs/tutorials/desktop-sandbox", |
| 42 | + useCases: ["Remote desktops", "Browser automation", "Visual apps"] |
| 43 | + }, |
| 44 | + { |
| 45 | + title: "Store agent memory", |
| 46 | + description: "Persist and retrieve AI agent context and knowledge", |
| 47 | + icons: [faDatabase], |
| 48 | + href: "/docs/tutorials/agent-memory", |
| 49 | + useCases: ["RAG", "Vector embeddings", "AI agent state"] |
| 50 | + } |
| 51 | + ]; |
| 52 | + |
| 53 | + return ( |
| 54 | + <div className="mx-auto max-w-7xl px-6 py-28 lg:py-44 lg:px-8 mt-16"> |
| 55 | + <div className="text-center mb-12"> |
| 56 | + <h2 className="text-3xl font-bold tracking-tight text-white">Start building in seconds</h2> |
| 57 | + <p className="mt-4 text-lg text-white/70">Follow our step-by-step tutorials to deploy your first project quickly</p> |
| 58 | + </div> |
| 59 | + <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8"> |
| 60 | + {tutorials.map((tutorial, index) => ( |
| 61 | + <Link key={index} href={tutorial.href} className="group"> |
| 62 | + <div className="rounded-xl h-[280px] bg-[#121212] group-hover:bg-zinc-800/90 border border-white/5 group-hover:border-white/20 shadow-sm transition-all duration-200 flex flex-col overflow-hidden"> |
| 63 | + {/* Top section with icons */} |
| 64 | + <div className="bg-black/40 p-4 flex items-center justify-center h-[120px] w-full"> |
| 65 | + <div className="flex space-x-4"> |
| 66 | + {tutorial.icons.map((icon, iconIndex) => ( |
| 67 | + <div key={iconIndex} className="flex items-center justify-center w-14 h-14"> |
| 68 | + <Icon |
| 69 | + icon={icon} |
| 70 | + className="text-4xl text-white/50 group-hover:text-[#FF5C00] transition-colors duration-200" |
| 71 | + /> |
| 72 | + </div> |
| 73 | + ))} |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + |
| 77 | + {/* Bottom section with content */} |
| 78 | + <div className="p-5 flex flex-col flex-1"> |
| 79 | + <h3 className="text-xl font-semibold text-white mb-2">{tutorial.title}</h3> |
| 80 | + <p className="text-white/60 text-sm">{tutorial.description}</p> |
| 81 | + |
| 82 | + <div className="flex items-center mt-auto pt-3 text-[#FF5C00] opacity-0 group-hover:opacity-100 transition-opacity"> |
| 83 | + <span className="text-sm font-medium">View tutorial</span> |
| 84 | + <Icon icon={faArrowRight} className="ml-2 text-xs group-hover:translate-x-0.5 transition-all" /> |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + </Link> |
| 89 | + ))} |
| 90 | + </div> |
| 91 | + </div> |
| 92 | + ); |
| 93 | +}; |
0 commit comments