@@ -5,7 +5,7 @@ import { DeleteButton } from "@/components/DeleteAgentButton";
55import KagentLogo from "@/components/kagent-logo" ;
66import Link from "next/link" ;
77import { useRouter } from "next/navigation" ;
8- import { Pencil , AlertCircle , Clock } from "lucide-react" ;
8+ import { Pencil } from "lucide-react" ;
99import { k8sRefUtils } from "@/lib/k8sUtils" ;
1010import { cn } from "@/lib/utils" ;
1111
@@ -19,6 +19,7 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
1919 agent . metadata . namespace || '' ,
2020 agent . metadata . name || ''
2121 ) ;
22+
2223 const isBYO = agent . spec ?. type === "BYO" ;
2324 const byoImage = isBYO ? agent . spec ?. byo ?. deployment ?. image : undefined ;
2425 const isReady = deploymentReady && accepted ;
@@ -29,6 +30,24 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
2930 router . push ( `/agents/new?edit=true&name=${ agent . metadata . name } &namespace=${ agent . metadata . namespace } ` ) ;
3031 } ;
3132
33+ const getStatusInfo = ( ) => {
34+ if ( ! accepted ) {
35+ return {
36+ message : "Agent not Accepted" ,
37+ className :"bg-red-500/10 text-red-600 dark:text-red-500"
38+ } ;
39+ }
40+ if ( ! deploymentReady ) {
41+ return {
42+ message : "Agent not Ready" ,
43+ className :"bg-yellow-400/30 text-yellow-800 dark:bg-yellow-500/40 dark:text-yellow-200"
44+ } ;
45+ }
46+ return null ;
47+ } ;
48+
49+ const statusInfo = getStatusInfo ( ) ;
50+
3251 const cardContent = (
3352 < Card className = { cn (
3453 "group relative transition-all duration-200 overflow-hidden min-h-[200px]" ,
@@ -69,37 +88,12 @@ export function AgentCard({ agentResponse: { agent, model, modelProvider, deploy
6988 ) }
7089 </ div >
7190 </ CardContent >
72-
73- { ! isReady && (
91+ { statusInfo && (
7492 < div className = { cn (
75- "absolute inset-0 rounded-xl flex flex-col items-center justify-center z-20 backdrop-blur-[2px]" ,
76- ! accepted
77- ? "bg-destructive/90"
78- : "bg-secondary/90"
93+ "absolute bottom-0 left-0 right-0 z-20 py-1.5 px-4 text-right text-xs font-medium rounded-b-xl" ,
94+ statusInfo . className
7995 ) } >
80- < div className = "text-center px-6 py-8 max-w-[80%]" >
81- < div className = "flex justify-center mb-4" >
82- { ! accepted ? (
83- < AlertCircle className = "h-12 w-12 text-destructive-foreground drop-shadow-lg" />
84- ) : (
85- < Clock className = "h-12 w-12 text-secondary-foreground drop-shadow-lg" />
86- ) }
87- </ div >
88- < h3 className = { cn (
89- "font-bold text-2xl mb-3 drop-shadow-lg" ,
90- ! accepted ? "text-destructive-foreground" : "text-secondary-foreground"
91- ) } >
92- { ! accepted ? "Agent not Accepted" : "Agent not Ready" }
93- </ h3 >
94- < p className = { cn (
95- "text-base drop-shadow" ,
96- ! accepted ? "text-destructive-foreground/95" : "text-secondary-foreground/90"
97- ) } >
98- { ! accepted
99- ? "Configuration needs review"
100- : "Still deploying..." }
101- </ p >
102- </ div >
96+ { statusInfo . message }
10397 </ div >
10498 ) }
10599 </ Card >
0 commit comments