From 775299fc6c4be62dedc84d7f41b82f966e85a66f Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Fri, 15 May 2026 01:48:56 +0600 Subject: [PATCH] refactor: redesign withdrawal page layout and UI components for improved clarity --- src/app/investor/withdraw/page.tsx | 347 ++++++++++++++--------------- 1 file changed, 167 insertions(+), 180 deletions(-) diff --git a/src/app/investor/withdraw/page.tsx b/src/app/investor/withdraw/page.tsx index 8814501..2433d54 100644 --- a/src/app/investor/withdraw/page.tsx +++ b/src/app/investor/withdraw/page.tsx @@ -1,7 +1,7 @@ 'use client'; import { useState } from 'react'; -import { CreditCard, Wallet, ArrowUpRight, History, CheckCircle, Clock, Building2, Smartphone, AlertCircle, ChevronDown, Settings, X, Bike } from 'lucide-react'; +import { CreditCard, Wallet, ArrowUpRight, History, CheckCircle, Clock, Building2, Smartphone, AlertCircle, Settings, X, Bike } from 'lucide-react'; import { investors, transactions, bikes } from '@/data/mockData'; import toast from 'react-hot-toast'; @@ -96,115 +96,110 @@ export default function InvestorWithdrawPage() { }; return ( -
-
-

Withdraw Funds

-

Request withdrawals to your bank or mobile banking accounts

+
+ {/* Header */} +
+
+

Withdraw Funds

+

Request withdrawals to your bank or mobile banking accounts

+
+
-
- {/* Balance Overview */} -
-
-
-
-
- - Available Balance -
-

- ৳{availableBalance.toLocaleString()} -

-

Ready to withdraw

-
- -
-
-

Pending Request

-

৳{investor.pendingEarnings.toLocaleString()}

-
-
-

Total Withdrawn

-

৳{investor.totalWithdrawn.toLocaleString()}

-
-
-
- -
- -
-

Pending Requests

-

You currently have ৳{investor.pendingEarnings.toLocaleString()} in pending withdrawals. Processing takes 1-3 business days.

+ {/* Balance Cards */} +
+
+
+
+
+ + Available Balance
+

৳{availableBalance.toLocaleString()}

+

Ready to withdraw

- - {/* Right Side */} -
- - {/* Withdraw Button */} - +
+

Pending Request

+

৳{investor.pendingEarnings.toLocaleString()}

+
+
+

Total Withdrawn

+

৳{investor.totalWithdrawn.toLocaleString()}

- {/* Withdrawal History */} -
-

- Recent Withdrawals -

-
-
- - - - - - - - - - - - {withdrawHistory.length > 0 ? withdrawHistory.map((t) => ( - - - - - - + + )) : ( + + + + )} + +
DateRef / DescMethodAmountStatus
{t.createdAt} -

{t.referenceNumber || 'Withdrawal'}

-

{t.description}

-
{t.paymentMethod}৳{t.amount.toLocaleString()} - +
+ +
+

Pending Requests

+

You currently have ৳{investor.pendingEarnings.toLocaleString()} in pending withdrawals. Processing takes 1-3 business days.

+
+
+ + + + {/* Recent Withdrawals */} +
+
+

+ Recent Withdrawals +

+
+
+ + + + + + + + + + + + {withdrawHistory.length > 0 ? withdrawHistory.map((t) => ( + + + + + + - - )) : ( - - - - )} - -
DateRef / DescMethodAmountStatus
{t.createdAt} +

{t.referenceNumber || 'Withdrawal'}

+

{t.description}

+
{t.paymentMethod}৳{t.amount.toLocaleString()} + - {t.status === 'completed' && } - {t.status === 'pending' && } - {t.status} - -
- No withdrawal history found. -
-
+ }`}> + {t.status === 'completed' && } + {t.status === 'pending' && } + {t.status} + +
+ + No withdrawal history found. +
@@ -212,9 +207,9 @@ export default function InvestorWithdrawPage() { {showWithdrawModal && (
-
+

Create Withdrawal Request

-
@@ -222,15 +217,15 @@ export default function InvestorWithdrawPage() {
{/* Balance Cards */}
-
+

Available Balance

৳{availableBalance.toLocaleString()}

-
+

Pending Request

৳{investor.pendingEarnings.toLocaleString()}

-
+

Total Withdrawn

৳{investor.totalWithdrawn.toLocaleString()}

@@ -247,18 +242,18 @@ export default function InvestorWithdrawPage() { id="selectAll" checked={selectAll} onChange={(e) => toggleSelectAll(e.target.checked)} - className="w-4 h-4 text-investor rounded" + className="w-5 h-5 text-investor rounded border-slate-300" /> -
{/* Investment Plans with Bikes */}
-
-

Investment Plans

+
+

Investment Plans

{investor.investments?.map((inv: any) => { @@ -273,34 +268,37 @@ export default function InvestorWithdrawPage() { checked={selectAll || selectedPlans.includes(inv.id)} disabled={selectAll} onChange={() => togglePlan(inv.id, invBikes)} - className="w-4 h-4 text-investor rounded" + className="w-5 h-5 text-investor rounded border-slate-300" /> -