repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | import type React from "react"; |
| #2 | import { ArrowRight } from "lucide-react"; |
| #3 | import { |
| #4 | Card, |
| #5 | CardContent, |
| #6 | CardFooter, |
| #7 | CardHeader, |
| #8 | } from "@/components/ui/card"; |
| #9 | |
| #10 | import { constants } from "@/components/shared/source-app"; |
| #11 | import { App } from "@/store/appsSlice"; |
| #12 | import Image from "next/image"; |
| #13 | import { useRouter } from "next/navigation"; |
| #14 | |
| #15 | interface AppCardProps { |
| #16 | app: App; |
| #17 | } |
| #18 | |
| #19 | export function AppCard({ app }: AppCardProps) { |
| #20 | const router = useRouter(); |
| #21 | const appConfig = |
| #22 | constants[app.name as keyof typeof constants] || constants.default; |
| #23 | const isActive = app.is_active; |
| #24 | |
| #25 | return ( |
| #26 | <Card className="bg-zinc-900 text-white border-zinc-800"> |
| #27 | <CardHeader className="pb-2"> |
| #28 | <div className="flex items-center gap-1"> |
| #29 | <div className="relative z-10 rounded-full overflow-hidden bg-[#2a2a2a] w-6 h-6 flex items-center justify-center flex-shrink-0"> |
| #30 | {appConfig.iconImage ? ( |
| #31 | <div className="w-6 h-6 rounded-full bg-zinc-700 flex items-center justify-center overflow-hidden"> |
| #32 | <Image |
| #33 | src={appConfig.iconImage} |
| #34 | alt={appConfig.name} |
| #35 | width={28} |
| #36 | height={28} |
| #37 | /> |
| #38 | </div> |
| #39 | ) : ( |
| #40 | <div className="w-6 h-6 flex items-center justify-center"> |
| #41 | {appConfig.icon} |
| #42 | </div> |
| #43 | )} |
| #44 | </div> |
| #45 | <h2 className="text-xl font-semibold">{appConfig.name}</h2> |
| #46 | </div> |
| #47 | </CardHeader> |
| #48 | <CardContent className="pb-4 my-1"> |
| #49 | <div className="grid grid-cols-2 gap-4"> |
| #50 | <div> |
| #51 | <p className="text-zinc-400 text-sm mb-1">Memories Created</p> |
| #52 | <p className="text-xl font-medium"> |
| #53 | {app.total_memories_created.toLocaleString()} Memories |
| #54 | </p> |
| #55 | </div> |
| #56 | <div> |
| #57 | <p className="text-zinc-400 text-sm mb-1">Memories Accessed</p> |
| #58 | <p className="text-xl font-medium"> |
| #59 | {app.total_memories_accessed.toLocaleString()} Memories |
| #60 | </p> |
| #61 | </div> |
| #62 | </div> |
| #63 | </CardContent> |
| #64 | <CardFooter className="border-t border-zinc-800 p-0 px-6 py-2 flex justify-between items-center"> |
| #65 | <div |
| #66 | className={`${ |
| #67 | isActive |
| #68 | ? "bg-green-800 text-white hover:bg-green-500/20" |
| #69 | : "bg-red-500/20 text-red-400 hover:bg-red-500/20" |
| #70 | } rounded-lg px-2 py-0.5 flex items-center text-sm`} |
| #71 | > |
| #72 | <span className="h-2 w-2 my-auto mr-1 rounded-full inline-block bg-current"></span> |
| #73 | {isActive ? "Active" : "Inactive"} |
| #74 | </div> |
| #75 | <div |
| #76 | onClick={() => router.push(`/apps/${app.id}`)} |
| #77 | className="border hover:cursor-pointer border-zinc-700 bg-zinc-950 flex items-center px-3 py-1 text-sm rounded-lg text-white p-0 hover:bg-zinc-950/50 hover:text-white" |
| #78 | > |
| #79 | View Details <ArrowRight className="ml-2 h-4 w-4" /> |
| #80 | </div> |
| #81 | </CardFooter> |
| #82 | </Card> |
| #83 | ); |
| #84 | } |
| #85 |