<template>
    <!-- 公共组件 -->
    <div class="info">
        <v-head :title="'Withdraw'" :show_more="true" :show_help="true" :back_url="'/'"></v-head>
        <currency-list style="height: calc(100% - 48px);" :filterEmptyBalance="true" @selectCurrency="selectCurrency" ></currency-list>
    </div>

</template>

<script setup>
import VHead from '@/view/popup/components/head.vue'
import CurrencyList from "@/view/components/currency-list.vue";
import router from "@/router/popup.js";
import Report from "@/log-center/log";
import { inject, onMounted } from 'vue'
let withdraw_info = inject('withdraw_info')

function selectCurrency(_params) {

    if (_params.currencyCode == 'USD') {
        withdraw_info.currency_code = _params.currencyCode
        router.push('/withdraw/paypal')
    } else {
        withdraw_info.source = 'home'
        withdraw_info.balance = _params.balance
        withdraw_info.token_symbol = _params.tokenSymbol || ''
        withdraw_info.currency_name = _params.currencyName || ''
        withdraw_info.token_chain = _params.tokenChain || 'BNB Chain'
        // withdraw_info.token_chain = 'BNB Smart Chain (BEP20)'
        withdraw_info.currency_code = _params.currencyCode
        withdraw_info.icon_token = _params.iconPath || ''
        withdraw_info.icon_net = require('@/assets/svg/icon-BNB.svg')
        router.push('/withdraw/info')
    }

}

onMounted(() => {
    Report.reportLog({
        pageSource: Report.pageSource.denetWithdrawSelector,
        businessType: Report.businessType.pageView,
    });
})
</script>


<style lang='scss' scoped>
.info {
    height: 100%;
    overflow: hidden;
}
</style>
