-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(operate) fix: replace run agent button with pearl and quickstart
- Loading branch information
Atatakai
authored and
Atatakai
committed
Aug 23, 2024
1 parent
ad7e72d
commit 3ced53f
Showing
3 changed files
with
60 additions
and
63 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
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
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,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: <Image src={`/images/pearl.svg`} alt="Pearl app" width={18} height={18} />, | ||
text: 'Pearl', | ||
href: 'https://olas.network/operate#download', | ||
}, | ||
quickstart: { | ||
icon: <Image src={`/images/github.svg`} alt="Github" width={18} height={18} />, | ||
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 ( | ||
<Button type={type} className={className} disabled> | ||
Not available yet | ||
</Button> | ||
); | ||
const agentProps = props[availableOn]; | ||
|
||
return ( | ||
<Button type={type} className={className} href={agentProps.href} target="_blank"> | ||
<Flex gap={8} align="center" justify="center"> | ||
{agentProps.icon} {agentProps.text} {UNICODE_SYMBOLS.EXTERNAL_LINK} | ||
</Flex> | ||
</Button> | ||
); | ||
}; |