diff --git a/src/pages/wallet/wallet-history/WalletHistory.tsx b/src/pages/wallet/wallet-history/WalletHistory.tsx index d914746..641ba29 100644 --- a/src/pages/wallet/wallet-history/WalletHistory.tsx +++ b/src/pages/wallet/wallet-history/WalletHistory.tsx @@ -7,11 +7,11 @@ const WalletHistory = () => { return ( <> - TPAY | Wallet History + TPAY | Wallet Statement -

Wallet History

+

Wallet Statement

Dashboard @@ -22,7 +22,7 @@ const WalletHistory = () => { - Wallet History + Wallet Statement diff --git a/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx b/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx index 6eb8298..44ccbb8 100644 --- a/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx +++ b/src/pages/wallet/wallet-history/blocks/ListToolbar.tsx @@ -38,7 +38,6 @@ const ListToolbar = () => { const [searchValue, setSearchValue] = useState( (table.getColumn('msisdn')?.getFilterValue() as string) ?? '' ); - const [dateRange, setDateRange] = useState({ from: '', to: '' }); const [walletId, setWalletId] = useState( (table.getColumn('id_wallet')?.getFilterValue() as string) ?? '' ); @@ -48,12 +47,6 @@ const ListToolbar = () => { const [wallets, setWallets] = useState([]); const [groups, setGroups] = useState([]); - useEffect(() => { - const today = new Date(); - const threeMonthsAgo = getOneMonthsAgo(); - setDateRange({ from: formatDate(threeMonthsAgo), to: formatDate(today) }); - }, []); - useEffect(() => { const timer = setTimeout(() => { table.getColumn('msisdn')?.setFilterValue(searchValue); @@ -62,15 +55,6 @@ const ListToolbar = () => { return () => clearTimeout(timer); }, [searchValue, table]); - const handleFilterByDate = useCallback(() => { - try { - table.getColumn('CreatedAt')?.setFilterValue(dateRange); - } catch (error) { - toast.error('Error applying date filter'); - console.error('Error applying date filter:', error); - } - }, [dateRange, table]); - useEffect(() => { table.getColumn('id_wallet')?.setFilterValue(walletId); table.setPageIndex(0); @@ -81,12 +65,6 @@ const ListToolbar = () => { table.setPageIndex(0); }, [groupId, table]); - useEffect(() => { - if (dateRange.from && dateRange.to) { - handleFilterByDate(); - } - }, [dateRange, handleFilterByDate]); - const fetchWallets = async () => { try { const response = await GetData(`${API_URL_WALLET}/dashboard/wallet/`, { @@ -129,23 +107,22 @@ const ListToolbar = () => { from: formatDate(oneMonthAgo), to: formatDate(today) }; - + setSearchValue(''); setWalletId(''); setGroupId(''); - setDateRange(resetDateRange); - + table.getColumn('msisdn')?.setFilterValue(''); table.getColumn('id_wallet')?.setFilterValue(''); table.getColumn('id_group')?.setFilterValue(''); table.getColumn('CreatedAt')?.setFilterValue(resetDateRange); - + setTimeout(() => { table.setPageIndex(0); reload(); }, 0); }; - + const handleRefresh = () => { const today = new Date(); const threeMonthsAgo = getOneMonthsAgo(); @@ -157,7 +134,6 @@ const ListToolbar = () => { setSearchValue(''); setWalletId(''); setGroupId(''); - setDateRange(resetDateRange); table.setColumnFilters([{ id: 'CreatedAt', value: resetDateRange }]); table.setPageIndex(0); @@ -169,24 +145,6 @@ const ListToolbar = () => {
- - - -