import { ArrowRightOutlined, LoadingOutlined, PauseCircleOutlined } from '@ant-design/icons' import { Timeline, Typography } from 'antd' import { sKLIMA_ADDRESS } from '../../../constants' import { renderProcessError, renderProcessMessage } from '../../../services/processRenderer' import { formatTokenAmount } from '../../../services/utils' import { Execution, Step, Token } from '../../../types' import Clock from '../../Clock' const SKLIMA_TOKEN_POL = { symbol: 'sKLIMA', decimals: 9, name: 'sKLIMA', chainId: 137, address: sKLIMA_ADDRESS, } interface EtherspotStepProps { stakingStep: Step isSwapping: boolean etherspotStepExecution?: Execution index: number previousStepInfo: { token?: Token; amount?: string } isMobile: boolean } export const EtherspotStep = ({ etherspotStepExecution, stakingStep, isSwapping, index, previousStepInfo, isMobile, }: EtherspotStepProps) => { const parseEtherspotExecution = () => { if (!etherspotStepExecution) { return [] } return etherspotStepExecution.process.map((process, index, processList) => { const type = process.status === 'DONE' ? 'success' : process.status === 'FAILED' ? 'danger' : undefined const hasFailed = process.status === 'FAILED' const isLastPendingProcess = index === processList.length - 1 && process.status === 'PENDING' return (

{renderProcessMessage(process)}

{hasFailed && ( {renderProcessError(process)} )}
) }) } const parseEtherspotStep = () => { const isDone = etherspotStepExecution && etherspotStepExecution.status === 'DONE' const isLoading = isSwapping && etherspotStepExecution && etherspotStepExecution.status === 'PENDING' const isPaused = !isSwapping && etherspotStepExecution && etherspotStepExecution.status === 'PENDING' const color = isDone ? 'green' : etherspotStepExecution ? 'blue' : 'gray' return [

Stake for sKLIMA

{formatTokenAmount(previousStepInfo.token!, previousStepInfo.amount!)}{' '} {' '} {formatTokenAmount(SKLIMA_TOKEN_POL, stakingStep.estimate?.toAmount)}
, : isPaused ? : null}> {parseEtherspotExecution()} , ] } return parseEtherspotStep() }