import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Grid, Typography, ToggleButtonGroup, ToggleButton } from '@mui/material'; import currencies from '../../../../static/assets/currencies.json'; import { Order } from '../../../models'; import { pn } from '../../../utils'; import { Bolt, Link } from '@mui/icons-material'; import { LightningPayoutForm, LightningForm, OnchainPayoutForm, OnchainForm } from '../Forms'; interface PayoutPrompProps { order: Order; onClickSubmitInvoice: (invoice: string) => void; lightning: LightningForm; loadingLightning: boolean; setLightning: (state: LightningForm) => void; onClickSubmitAddress: () => void; onchain: OnchainForm; setOnchain: (state: OnchainForm) => void; loadingOnchain: boolean; } export const PayoutPrompt = ({ order, onClickSubmitInvoice, loadingLightning, lightning, setLightning, onClickSubmitAddress, loadingOnchain, onchain, setOnchain, }: PayoutPrompProps): JSX.Element => { const { t } = useTranslation(); const currencyCode: string = currencies[`${order.currency}`]; const [tab, setTab] = useState<'lightning' | 'onchain'>('lightning'); return ( {t( 'Before letting you send {{amountFiat}} {{currencyCode}}, we want to make sure you are able to receive the BTC.', { amountFiat: pn( parseFloat(parseFloat(order.amount).toFixed(order.currency == 1000 ? 8 : 4)), ), currencyCode, }, )} setTab(value)} >
{t('Lightning')}
{t('Onchain')}
{/* ONCHAIN PAYOUT TAB */}
); }; export default PayoutPrompt;