-
Notifications
You must be signed in to change notification settings - Fork 45k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into reinier/open-1806-implement-front-to-back-…
…github-oauth-support-on-blocks
- Loading branch information
Showing
3 changed files
with
102 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React from "react"; | ||
import { Button } from "./ui/button"; | ||
import { LogOut } from "lucide-react"; | ||
import { IconPlay, IconSquare } from "@/components/ui/icons"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "@/components/ui/tooltip"; | ||
|
||
interface PrimaryActionBarProps { | ||
onClickAgentOutputs: () => void; | ||
onClickRunAgent: () => void; | ||
isRunning: boolean; | ||
requestStopRun: () => void; | ||
runAgentTooltip: string; | ||
} | ||
|
||
const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({ | ||
onClickAgentOutputs, | ||
onClickRunAgent, | ||
isRunning, | ||
requestStopRun, | ||
runAgentTooltip, | ||
}) => { | ||
const runButtonLabel = !isRunning ? "Run" : "Stop"; | ||
|
||
const runButtonIcon = !isRunning ? <IconPlay /> : <IconSquare />; | ||
|
||
const runButtonOnClick = !isRunning ? onClickRunAgent : requestStopRun; | ||
|
||
return ( | ||
<div className="absolute bottom-0 left-0 right-0 z-50 flex items-center justify-center p-4"> | ||
<div className={`flex gap-4`}> | ||
<Tooltip key="ViewOutputs" delayDuration={500}> | ||
<TooltipTrigger asChild> | ||
<Button | ||
className="flex items-center gap-2" | ||
onClick={onClickAgentOutputs} | ||
size="primary" | ||
variant="outline" | ||
> | ||
<LogOut className="h-5 w-5" /> | ||
<span className="text-lg font-medium">Agent Outputs </span> | ||
</Button> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>View agent outputs</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
<Tooltip key="RunAgent" delayDuration={500}> | ||
<TooltipTrigger asChild> | ||
<Button | ||
className="flex items-center gap-2" | ||
onClick={runButtonOnClick} | ||
size="primary" | ||
style={{ | ||
background: isRunning ? "#FFB3BA" : "#7544DF", | ||
opacity: 1, | ||
}} | ||
> | ||
{runButtonIcon} | ||
<span className="text-lg font-medium">{runButtonLabel}</span> | ||
</Button> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>{runAgentTooltip}</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default PrimaryActionBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters