import React, { useEffect, useState } from 'react'; import { Modal, View, StyleSheet } from 'react-native'; import apiPayment from '../../api/apiPayment'; import Button from '../../components/Button'; import Dialog from '../../components/Dialog'; import TextView from '../../components/TextView'; import { i18nUtil } from '../../i18n'; const DialogPayPerUse = ({ amount="", visible, onClose }) => { const [content, setContent] = useState(); useEffect(() => { if (i18nUtil.isChinese()) { setContent($t("payment.tipsPayPerUseAmount").replace("{mm}", amount)); } else { apiPayment.getPayPerUseAlter().then(res => { if (res.data) { setContent(res.data); } }).catch(err => { setContent($t("payment.tipsPayPerUseAmount").replace("{mm}", amount)); }); } }, []); return ( {$t("payment.titleNote")} {content}