import React, { useEffect, useState } from 'react'; import { HiBars3BottomLeft } from "react-icons/hi2"; import { FaCheck } from "react-icons/fa6"; import '../App.css'; import WithdrawalForm from './Cekimform'; import axios from 'axios'; const BASE_URL = "http://localhost:8000"; const WithdrawalContent = () => { const [showFilterMenu, setShowFilterMenu] = useState(true); const [showModal, setShowModal] = useState(false); const [bankAccounts, setBankAccounts] = useState([]); const [selectedAccount, setSelectedAccount] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const [minAmount, setMinAmount] = useState(''); const [maxAmount, setMaxAmount] = useState(''); const [startDate, setStartDate] = useState(''); const [endDate, setEndDate] = useState(''); useEffect(() => { fetchBankAccounts(); }, []); const fetchBankAccounts = async () => { const token = localStorage.getItem('token'); setLoading(true); try { const response = await axios.get(`${BASE_URL}/bank/accounts`, { headers: { 'Authorization': `Bearer ${token}` } }); // Filter accounts that allow withdrawals (isPull is true) const withdrawalAccounts = response.data.data.filter(account => account.isPull); setBankAccounts(withdrawalAccounts); } catch (err) { setError('Banka hesapları yüklenirken bir hata oluştu'); console.error('Error fetching bank accounts:', err); } finally { setLoading(false); } }; const toggleFilterMenu = () => { setShowFilterMenu(prevState => !prevState); }; return (