import React, { useState, useEffect } from 'react' import { Modal, Alert, Space, Button, Typography } from 'antd' import { CheckCircleOutlined, ExclamationCircleOutlined, WalletOutlined } from '@ant-design/icons' import { useTranslation } from 'react-i18next' import { useMediaQuery } from 'react-responsive' import AccountSetupStatusBlock from './AccountSetupStatusBlock' import type { SetupStatus } from './AccountSetupStatusBlock' const { Text } = Typography interface AccountSetupGuideModalProps { visible: boolean setupStatus: SetupStatus | null accountId?: number onClose: () => void onComplete?: () => void } const AccountSetupGuideModal: React.FC = ({ visible, setupStatus: _initialStatus, accountId, onClose, onComplete }) => { const { t } = useTranslation() const isMobile = useMediaQuery({ maxWidth: 768 }) const [allCompleted, setAllCompleted] = useState(false) useEffect(() => { if (visible) setAllCompleted(false) }, [visible, accountId]) if (!visible) return null return ( {t('accountSetup.title')} } open={visible} onCancel={onClose} footer={
{allCompleted ? ( ) : ( )}
} width={isMobile ? '95%' : 680} style={{ top: isMobile ? 20 : 50 }} destroyOnClose maskClosable={allCompleted} closable >
{allCompleted ? ( } showIcon style={{ marginBottom: 24 }} /> ) : ( } showIcon style={{ marginBottom: 24 }} /> )} {accountId != null && accountId > 0 ? ( setAllCompleted(true)} onRefresh={onComplete} /> ) : ( {t('accountSetup.error.description')} )}
{t('accountSetup.help')}
) } export default AccountSetupGuideModal