mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(platform/library): Add icons to primary agent run action buttons (#9651)
- Resolves #9612 ### Changes 🏗️ - Add icon to "Run" button in run draft view - Add icons "Stop run" and "Run again" buttons in run view    ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - Purely visual changes, no functional test needed. Technical changes are covered by the type checker.
This commit is contained in:
committed by
Zamil Majdy
parent
9b19d1959e
commit
2c92122721
@@ -11,6 +11,7 @@ import {
|
||||
|
||||
import type { ButtonAction } from "@/components/agptui/types";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { IconRefresh, IconSquare } from "@/components/ui/icons";
|
||||
import { Button } from "@/components/agptui/Button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
@@ -121,14 +122,29 @@ export default function AgentRunDetailsView({
|
||||
...(["running", "queued"].includes(runStatus)
|
||||
? ([
|
||||
{
|
||||
label: "Stop run",
|
||||
label: (
|
||||
<>
|
||||
<IconSquare className="mr-2 size-4" />
|
||||
Stop run
|
||||
</>
|
||||
),
|
||||
variant: "secondary",
|
||||
callback: stopRun,
|
||||
},
|
||||
] satisfies ButtonAction[])
|
||||
: []),
|
||||
...(["success", "failed", "stopped"].includes(runStatus)
|
||||
? [{ label: "Run again", callback: runAgain }]
|
||||
? [
|
||||
{
|
||||
label: (
|
||||
<>
|
||||
<IconRefresh className="mr-2 size-4" />
|
||||
Run again
|
||||
</>
|
||||
),
|
||||
callback: runAgain,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{ label: "Delete run", variant: "secondary", callback: deleteRun },
|
||||
],
|
||||
|
||||
@@ -7,6 +7,7 @@ import { GraphExecutionID, GraphMeta } from "@/lib/autogpt-server-api";
|
||||
import type { ButtonAction } from "@/components/agptui/types";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Button, ButtonProps } from "@/components/agptui/Button";
|
||||
import { IconPlay } from "@/components/ui/icons";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
export default function AgentRunDraftView({
|
||||
@@ -31,12 +32,19 @@ export default function AgentRunDraftView({
|
||||
[api, graph, inputValues, onRun],
|
||||
);
|
||||
|
||||
const runActions: {
|
||||
label: string;
|
||||
variant?: ButtonProps["variant"];
|
||||
callback: () => void;
|
||||
}[] = useMemo(
|
||||
() => [{ label: "Run", variant: "accent", callback: () => doRun() }],
|
||||
const runActions: ButtonAction[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
label: (
|
||||
<>
|
||||
<IconPlay className="mr-2 size-5" />
|
||||
Run
|
||||
</>
|
||||
),
|
||||
variant: "accent",
|
||||
callback: doRun,
|
||||
},
|
||||
],
|
||||
[doRun],
|
||||
);
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { ButtonProps } from "@/components/agptui/Button";
|
||||
import React from "react";
|
||||
|
||||
export type ButtonAction = {
|
||||
label: string;
|
||||
label: React.ReactNode;
|
||||
variant?: ButtonProps["variant"];
|
||||
callback: () => void;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user