diff --git a/apps/operate/components/Agents.tsx b/apps/operate/components/Agents.tsx index 01ba68a7..2110705d 100644 --- a/apps/operate/components/Agents.tsx +++ b/apps/operate/components/Agents.tsx @@ -1,10 +1,13 @@ -import { BulbFilled, PlayCircleOutlined, RobotOutlined } from '@ant-design/icons'; -import { Button, Card, Col, Row, Typography } from 'antd'; +import { BulbFilled, RobotOutlined } from '@ant-design/icons'; +import { Button, Card, Col, Flex, Row, Typography } from 'antd'; import Image from 'next/image'; import styled from 'styled-components'; +import { StakingContract } from 'types'; import { BREAK_POINT, COLOR } from 'libs/ui-theme/src'; +import { RunAgentButton } from './RunAgentButton'; + const { Title, Paragraph } = Typography; const StyledMain = styled.main` @@ -46,6 +49,7 @@ type Agent = { name: string; description: string; comingSoon: boolean; + availableOn: StakingContract['availableOn'][]; urls: Record; imageFilename: string; }; @@ -56,8 +60,8 @@ const agents: Agent[] = [ name: 'Prediction Agent', description: 'Participates in prediction markets according to your strategy.', comingSoon: false, + availableOn: ['pearl', 'quickstart'], urls: { - run: 'https://github.com/valory-xyz/trader-quickstart?tab=readme-ov-file#trader-quickstart', learnMore: 'https://olas.network/services/prediction-agents', gpt: 'https://chat.openai.com/g/g-6y88mEBzS-olas-trader-agent-guide', }, @@ -66,8 +70,8 @@ const agents: Agent[] = [ ]; const AgentCard = ({ agent }: { agent: Agent }) => { - const { id, name, description, imageFilename, urls, comingSoon } = agent; - const { run, learnMore, gpt } = urls; + const { id, name, description, imageFilename, urls, comingSoon, availableOn } = agent; + const { learnMore, gpt } = urls; return ( @@ -92,20 +96,13 @@ const AgentCard = ({ agent }: { agent: Agent }) => { ) : ( <> - {run && ( - + {availableOn && ( + + {availableOn.map((type) => ( + + ))} + )} -
{learnMore && ( - ); - } - - return ( - - ); - }, + render: (availableOn) => , }, ]; diff --git a/apps/operate/components/RunAgentButton.tsx b/apps/operate/components/RunAgentButton.tsx new file mode 100644 index 00000000..2f05a10e --- /dev/null +++ b/apps/operate/components/RunAgentButton.tsx @@ -0,0 +1,42 @@ +import { Button, Flex } from 'antd'; +import { BaseButtonProps } from 'antd/es/button/button'; +import Image from 'next/image'; +import { StakingContract } from 'types'; + +import { UNICODE_SYMBOLS } from 'libs/util-constants/src'; + +type RunAgentButtonProps = { + availableOn: StakingContract['availableOn']; + type?: BaseButtonProps['type']; + className?: string; +}; + +const props = { + pearl: { + icon: Pearl app, + text: 'Pearl', + href: 'https://olas.network/operate#download', + }, + quickstart: { + icon: Github, + text: 'Quickstart', + href: 'https://github.com/valory-xyz/trader-quickstart?tab=readme-ov-file#trader-quickstart', + }, +}; +export const RunAgentButton = ({ availableOn, type = 'text', className }: RunAgentButtonProps) => { + if (availableOn === null) + return ( + + ); + const agentProps = props[availableOn]; + + return ( + + ); +};