Add full FOCO investor management system with CRUD, investments, and transactions

This commit is contained in:
sazzadulalambd
2026-04-22 01:02:45 +06:00
parent 5338038ea2
commit dab0c11b15
32 changed files with 7673 additions and 89 deletions

View File

@@ -0,0 +1,123 @@
import { DollarSign, Banknote, Clock, Check, X, AlertCircle } from 'lucide-react';
import { investors } from '@/data/mockData';
const investor = investors[0];
const withdrawalHistory = [
{ id: 'w1', amount: 3000, method: 'bKash', status: 'pending', date: '2024-03-20' },
{ id: 'w2', amount: 5000, method: 'Bank Transfer', status: 'completed', date: '2024-03-15' },
{ id: 'w3', amount: 2500, method: 'bKash', status: 'completed', date: '2024-02-28' },
];
export default function WithdrawPage() {
return (
<div className="p-4 lg:p-6">
<div className="flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4 mb-6">
<div>
<h1 className="text-2xl lg:text-3xl font-extrabold text-slate-800">Withdraw Earnings</h1>
<p className="text-sm text-slate-500 mt-1">Request withdrawals to your bank or bKash</p>
</div>
</div>
<div className="grid lg:grid-cols-3 gap-6 mb-8">
<div className="lg:col-span-2 bg-white rounded-xl shadow-sm border border-slate-100 p-6">
<h2 className="font-bold text-slate-800 mb-4">Request Withdrawal</h2>
<div className="mb-4">
<label className="text-sm font-medium text-slate-600 mb-2 block">Available Balance</label>
<p className="text-3xl font-extrabold text-green-600">{(investor.totalEarnings - investor.withdrawalPending).toLocaleString()}</p>
</div>
<div className="mb-4">
<label className="text-sm font-medium text-slate-600 mb-2 block">Amount</label>
<input
type="number"
placeholder="Enter amount"
className="w-full px-4 py-3 border border-slate-200 rounded-lg text-lg focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"
/>
</div>
<div className="mb-4">
<label className="text-sm font-medium text-slate-600 mb-2 block">Withdrawal Method</label>
<div className="grid grid-cols-2 gap-3">
<button className="py-3 px-4 border-2 border-accent bg-accent-light rounded-lg font-medium text-accent">
bKash
</button>
<button className="py-3 px-4 border border-slate-200 rounded-lg font-medium text-slate-600 hover:bg-slate-50">
Bank Transfer
</button>
</div>
</div>
<div className="mb-4">
<label className="text-sm font-medium text-slate-600 mb-2 block">Account Number</label>
<input
type="text"
placeholder="01XXXXXXXXX"
className="w-full px-4 py-3 border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-accent focus:border-transparent"
/>
</div>
<button className="w-full py-3 bg-accent text-white rounded-lg font-semibold hover:bg-accent-dark">
Request Withdrawal
</button>
</div>
<div className="bg-white rounded-xl shadow-sm border border-slate-100 p-5">
<h2 className="font-bold text-slate-800 mb-4">Quick Withdraw</h2>
<div className="space-y-2 mb-4">
<button className="w-full py-2 px-4 border border-slate-200 rounded-lg text-sm text-left hover:bg-slate-50">
1,000
</button>
<button className="w-full py-2 px-4 border border-slate-200 rounded-lg text-sm text-left hover:bg-slate-50">
2,500
</button>
<button className="w-full py-2 px-4 border border-slate-200 rounded-lg text-sm text-left hover:bg-slate-50">
5,000
</button>
<button className="w-full py-2 px-4 border border-slate-200 rounded-lg text-sm text-left hover:bg-slate-50">
All Available
</button>
</div>
<div className="p-3 bg-blue-50 rounded-lg">
<p className="text-sm text-blue-700 flex items-center gap-2">
<AlertCircle className="w-4 h-4" />
Processing time: 1-3 business days
</p>
</div>
</div>
</div>
<div className="bg-white rounded-xl shadow-sm border border-slate-100 overflow-hidden">
<div className="px-5 py-4 border-b border-slate-100">
<h2 className="font-bold text-slate-800">Withdrawal History</h2>
</div>
<div className="overflow-x-auto">
<table className="w-full">
<thead className="bg-slate-50">
<tr>
<th className="px-4 py-3 text-left text-xs font-semibold text-slate-500 uppercase">Date</th>
<th className="px-4 py-3 text-left text-xs font-semibold text-slate-500 uppercase">Method</th>
<th className="px-4 py-3 text-left text-xs font-semibold text-slate-500 uppercase">Amount</th>
<th className="px-4 py-3 text-left text-xs font-semibold text-slate-500 uppercase">Status</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-50">
{withdrawalHistory.map(w => (
<tr key={w.id} className="hover:bg-slate-50">
<td className="px-4 py-3 text-sm text-slate-600">{w.date}</td>
<td className="px-4 py-3 text-sm text-slate-600">{w.method}</td>
<td className="px-4 py-3 text-sm font-semibold text-slate-700">{w.amount}</td>
<td className="px-4 py-3">
<span className={`inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1 rounded-full ${
w.status === 'completed' ? 'bg-green-100 text-green-700' :
'bg-amber-100 text-amber-700'
}`}>
{w.status === 'completed' ? <Check className="w-3 h-3" /> : <Clock className="w-3 h-3" />}
{w.status}
</span>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
);
}