diff --git a/src/app/admin/investors/[id]/page copy.tsx b/src/app/admin/investors/[id]/page copy.tsx index a8208b2..ed6ffeb 100644 --- a/src/app/admin/investors/[id]/page copy.tsx +++ b/src/app/admin/investors/[id]/page copy.tsx @@ -5,9 +5,9 @@ import Link from 'next/link'; import { useParams } from 'next/navigation'; import { investors as initialInvestors, bikes as initialBikes, transactions as initialTransactions } from '@/data/mockData'; import type { Investor } from '@/data/mockData'; -import { - ArrowLeft, Wallet, TrendingUp, Banknote, Calendar, Phone, Mail, MapPin, Edit, Trash2, Plus, X, Bike, - User, FileText, CreditCard, DollarSign, Clock, ChevronDown, ExternalLink, Download, Upload, +import { + ArrowLeft, Wallet, TrendingUp, Banknote, Calendar, Phone, Mail, MapPin, Edit, Trash2, Plus, X, Bike, + User, FileText, CreditCard, DollarSign, Clock, ChevronDown, ExternalLink, Download, Upload, AlertTriangle, Shield, Star, CheckCircle, XCircle, Search, Filter, BookOpen, ArrowRight, Printer } from 'lucide-react'; @@ -42,13 +42,13 @@ const bikeStatusColors: Record = { export default function InvestorDetailPage() { const params = useParams(); const investorId = params.id as string; - + const [investors] = useState(initialInvestors); const investor = investors.find(i => i.id === investorId); - + const assignedBikes = initialBikes.filter(b => b.investorId === investorId); // Investor transactions are filtered below - + const [activeTab, setActiveTab] = useState('overview'); const [showEditModal, setShowEditModal] = useState(false); const [showAssignBikeModal, setShowAssignBikeModal] = useState(false); @@ -108,7 +108,7 @@ export default function InvestorDetailPage() { const invId = `INV-${Date.now()}`; const year = new Date().getFullYear(); const transactionRef = newInvestment.transactionReference || `INV/${year}/${String(investor.investments.length + 1).padStart(4, '0')}`; - + const getDebitAccount = (method: string) => { switch (method) { case 'bank': return { code: '1200', name: 'Bank - City Bank' }; @@ -118,9 +118,9 @@ export default function InvestorDetailPage() { default: return { code: '1200', name: 'Bank - City Bank' }; } }; - + const debitAccount = getDebitAccount(newInvestment.paymentMethod); - + const journalEntry = { entryId: `JE-${Date.now()}`, date: newInvestment.startDate, @@ -137,9 +137,9 @@ export default function InvestorDetailPage() { amount: newInvestment.totalInvestment, paymentMethod: newInvestment.paymentMethod }; - + setInvestorJournals([journalEntry, ...investorJournals]); - + console.log('Creating Investment:', { id: invId, investorId: investor.id, @@ -149,7 +149,7 @@ export default function InvestorDetailPage() { transactionId: transactionRef, createdAt: new Date().toISOString() }); - + alert(`Investment created successfully! Investor: ${investor.name} @@ -424,7 +424,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri

Assigned Bikes

- @@ -767,27 +767,25 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri {investorTransactions.map(tx => (
-
- +
+

{tx.description}

{tx.createdAt}

{tx.referenceNumber && ( -
-

+ }`}> {tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' || tx.type === 'referral_bonus' ? '+' : tx.type === 'withdrawal' || tx.type === 'penalty' || tx.type === 'adjustment' ? '-' : '+'}৳{tx.amount.toLocaleString()}

- + {tx.status}
@@ -875,23 +871,21 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri Upload Document
- +
{investor.kycDocuments?.map((doc, idx) => (
-
- + + doc.type === 'bank_statement' ? 'text-green-600' : + doc.type === 'tin_certificate' ? 'text-amber-600' : 'text-slate-600' + }`} />

{doc.type.replace('_', ' ')}

@@ -911,7 +905,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri -
@@ -928,11 +922,11 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri

KYC Status: {investor.kycStatus.toUpperCase()}

- {investor.kycStatus === 'verified' + {investor.kycStatus === 'verified' ? 'All documents have been verified. Investor is fully verified.' : investor.kycStatus === 'pending' - ? 'Documents are under review. Verification typically takes 24-48 hours.' - : 'Please upload required documents for verification.'} + ? 'Documents are under review. Verification typically takes 24-48 hours.' + : 'Please upload required documents for verification.'}

@@ -952,7 +946,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, planName: e.target.value })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm" @@ -998,7 +992,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- { @@ -1037,7 +1031,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, totalInvestment: Number(e.target.value), monthlyReturn: Math.round(Number(e.target.value) * newInvestment.expectedRoi / 100 / 12) })} @@ -1047,7 +1041,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, monthlyReturn: Number(e.target.value) })} @@ -1057,7 +1051,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, expectedRoi: Number(e.target.value) })} @@ -1070,7 +1064,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, startDate: e.target.value })} @@ -1079,7 +1073,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, endDate: e.target.value })} @@ -1091,7 +1085,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
- setNewInvestment({ ...newInvestment, transactionReference: e.target.value })} @@ -1116,7 +1110,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
-