1+ import { Shell } from "@/components/Shell" ;
2+ import { Card , CardContent , CardHeader , CardTitle , CardDescription , Button , Badge } from "ui" ;
3+ import Link from "next/link" ;
4+
5+ // Mock data - would come from API
6+ const deployments = [
7+ {
8+ id : 1 ,
9+ workflowName : "AI Executive Assistant" ,
10+ status : "active" ,
11+ lastRun : "2 minutes ago" ,
12+ config : {
13+ gmail : "user@example.com" ,
14+ summaryTime : "09:00" ,
15+ } ,
16+ } ,
17+ {
18+ id : 2 ,
19+ workflowName : "Discord Community Manager" ,
20+ status : "paused" ,
21+ lastRun : "3 hours ago" ,
22+ config : {
23+ server : "My Server" ,
24+ channels : 5 ,
25+ } ,
26+ } ,
27+ ] ;
28+
29+ const statusColors : Record < string , "success" | "secondary" | "destructive" > = {
30+ active : "success" ,
31+ paused : "secondary" ,
32+ failed : "destructive" ,
33+ } ;
34+
35+ export default function DeploymentsPage ( ) {
36+ const hasDeployments = deployments . length > 0 ;
37+
38+ return (
39+ < Shell >
40+ { /* Header */ }
41+ < div className = "flex items-center justify-between mb-8" >
42+ < div >
43+ < h1 className = "text-2xl font-semibold text-slate-900" > My Deployments</ h1 >
44+ < p className = "text-slate-500 mt-1" >
45+ Manage your deployed AI workflows
46+ </ p >
47+ </ div >
48+ < Link href = "/workflows" >
49+ < Button variant = "primary" > Deploy New Workflow</ Button >
50+ </ Link >
51+ </ div >
52+
53+ { /* Empty State */ }
54+ { ! hasDeployments && (
55+ < Card className = "border-slate-100" >
56+ < CardContent className = "pt-12 pb-12 text-center" >
57+ < div className = "text-4xl mb-4" > 🚀</ div >
58+ < h3 className = "text-lg font-medium text-slate-900 mb-2" >
59+ No deployments yet
60+ </ h3 >
61+ < p className = "text-slate-500 mb-6 max-w-md mx-auto" >
62+ Deploy your first AI workflow in under 10 minutes and start automating your daily tasks.
63+ </ p >
64+ < Link href = "/workflows" >
65+ < Button variant = "primary" > Browse Workflows</ Button >
66+ </ Link >
67+ </ CardContent >
68+ </ Card >
69+ ) }
70+
71+ { /* Deployments Grid */ }
72+ { hasDeployments && (
73+ < div className = "grid grid-cols-1 lg:grid-cols-2 gap-6" >
74+ { deployments . map ( ( deployment ) => (
75+ < Card key = { deployment . id } className = "border-slate-100" >
76+ < CardHeader >
77+ < div className = "flex items-start justify-between" >
78+ < div >
79+ < CardTitle > { deployment . workflowName } </ CardTitle >
80+ < CardDescription >
81+ Last run: { deployment . lastRun }
82+ </ CardDescription >
83+ </ div >
84+ < Badge variant = { statusColors [ deployment . status ] } >
85+ { deployment . status }
86+ </ Badge >
87+ </ div >
88+ </ CardHeader >
89+ < CardContent >
90+ < div className = "space-y-2 mb-4" >
91+ { Object . entries ( deployment . config ) . map ( ( [ key , value ] ) => (
92+ < div key = { key } className = "text-sm" >
93+ < span className = "text-slate-500 capitalize" > { key } : </ span >
94+ < span className = "text-slate-900" > { value } </ span >
95+ </ div >
96+ ) ) }
97+ </ div >
98+
99+ < div className = "flex gap-2" >
100+ < Button
101+ variant = "outline"
102+ size = "sm"
103+ className = "flex-1"
104+ >
105+ { deployment . status === "active" ? "Pause" : "Resume" }
106+ </ Button >
107+ < Button
108+ variant = "outline"
109+ size = "sm"
110+ className = "flex-1"
111+ >
112+ Reconfigure
113+ </ Button >
114+ < Button
115+ variant = "outline"
116+ size = "sm"
117+ className = "text-red-600 hover:text-red-700 hover:border-red-200"
118+ >
119+ Delete
120+ </ Button >
121+ </ div >
122+ </ CardContent >
123+ </ Card >
124+ ) ) }
125+ </ div >
126+ ) }
127+ </ Shell >
128+ ) ;
129+ }
0 commit comments