diff --git a/autogpt_platform/frontend/src/components/agptui/AgentRunStatusChip.tsx b/autogpt_platform/frontend/src/components/agptui/AgentRunStatusChip.tsx new file mode 100644 index 000000000000..d2d6c117a3de --- /dev/null +++ b/autogpt_platform/frontend/src/components/agptui/AgentRunStatusChip.tsx @@ -0,0 +1,48 @@ +import React from "react"; +import { Badge } from "@/components/ui/badge"; + +export type AgentRunStatus = + | "success" + | "failed" + | "queued" + | "running" + | "stopped" + | "draft"; + +const statusData: Record< + AgentRunStatus, + { label: string; variant: keyof typeof statusStyles } +> = { + success: { label: "Success", variant: "success" }, + failed: { label: "Failed", variant: "destructive" }, + queued: { label: "Queued", variant: "warning" }, + running: { label: "Running", variant: "info" }, + stopped: { label: "Stopped", variant: "secondary" }, + draft: { label: "Draft", variant: "secondary" }, +}; + +const statusStyles = { + success: + "bg-green-100 text-green-800 hover:bg-green-100 hover:text-green-800", + destructive: "bg-red-100 text-red-800 hover:bg-red-100 hover:text-red-800", + warning: + "bg-yellow-100 text-yellow-800 hover:bg-yellow-100 hover:text-yellow-800", + info: "bg-blue-100 text-blue-800 hover:bg-blue-100 hover:text-blue-800", + secondary: + "bg-slate-100 text-slate-800 hover:bg-slate-100 hover:text-slate-800", +}; + +export function AgentRunStatusChip({ + status, +}: { + status: AgentRunStatus; +}): React.ReactElement { + return ( + + {statusData[status].label} + + ); +} diff --git a/autogpt_platform/frontend/src/components/agptui/AgentRunSummaryCard.tsx b/autogpt_platform/frontend/src/components/agptui/AgentRunSummaryCard.tsx new file mode 100644 index 000000000000..2c23ea287e54 --- /dev/null +++ b/autogpt_platform/frontend/src/components/agptui/AgentRunSummaryCard.tsx @@ -0,0 +1,66 @@ +import React from "react"; +import moment from "moment"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { MoreVertical } from "lucide-react"; +import { AgentRunStatusChip, AgentRunStatus } from "./AgentRunStatusChip"; + +export type AgentRunSummaryProps = { + agentID: string; + agentRunID: string; + status: AgentRunStatus; + title: string; + timestamp: Date; +}; + +export function AgentRunSummaryCard({ + agentID, + agentRunID, + status, + title, + timestamp, +}: AgentRunSummaryProps): React.ReactElement { + return ( + + + + + + + {title} + + + + + + + + + + + Pin into a template + + Rename + Delete + + + + + + Ran {moment(timestamp).fromNow()} + + + + ); +} + +export default AgentRunSummaryCard;
+ Ran {moment(timestamp).fromNow()} +