import React, {useEffect, useState} from 'react';
import {Platform} from 'react-native';
import WithdrawView from './WithdrawView';

import {getListWidthDraw} from '../../../apis/Functions/Widthdraw';
import {Alert} from 'react-native';

const Withdraw = (props) => {
  const [listMethod, setListMethod] = useState([]);
  useEffect(() => {
    getData();
  }, []);

  const getData = async () => {
    const res = await getListWidthDraw({
      page_index: 1,
      page_size: 20,
      platform: Platform.OS,
    });

    if (res.data.code == 200) {
      setListMethod(res.data.data);
    } else {
      Alert.alert('Lấy danh sách phương thức rút tiền thất bại!');
    }
  };

  return <WithdrawView />;
};

export default Withdraw;
