-
Investment Not Found
-
The investment you're looking for doesn't exist.
-
-
Back to Portfolio
-
+
+
+
+
+
Investment Not Found
+
The investment you're looking for doesn't exist.
+
+
Back to Investments
+
+
);
@@ -45,307 +48,319 @@ export default function InvestorInvestmentDetailPage({ params }: { params: Promi
};
const style = planConfig[investment.planType] || planConfig.gold;
- const assignedBikes = bikes.filter((b: any) => b.investorId === investor.id && b.id === 'b1'); // mock filtering for this investment
+ const demoBikes = [
+ {
+ id: 'b1', model: 'Yadea DT3', brand: 'Yadea', plateNumber: 'AB-1234',
+ image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400&h=300&fit=crop',
+ status: 'rented', currentRent: 450, totalEarnings: 45000,
+ batteryLevel: 85, range: 60, location: 'Dhaka Central Hub'
+ },
+ {
+ id: 'b2', model: 'Apex E-Bike Pro', brand: 'Apex', plateNumber: 'CD-5678',
+ image: 'https://images.unsplash.com/photo-1622185135505-2d795043906a?w=400&h=300&fit=crop',
+ status: 'rented', currentRent: 500, totalEarnings: 52000,
+ batteryLevel: 72, range: 55, location: 'Gulshan Area'
+ },
+ {
+ id: 'b3', model: 'Niu NQi Sport', brand: 'Niu', plateNumber: 'EF-9012',
+ image: 'https://images.unsplash.com/photo-1591353230407-2b14a8e4c8d3?w=400&h=300&fit=crop',
+ status: 'available', currentRent: 0, totalEarnings: 28000,
+ batteryLevel: 95, range: 70, location: 'Mirpur Depot'
+ },
+ {
+ id: 'b4', model: 'Yadea DT3', brand: 'Yadea', plateNumber: 'GH-3456',
+ image: 'https://images.unsplash.com/photo-1558618666-fcd25c85cd64?w=400&h=300&fit=crop',
+ status: 'maintenance', currentRent: 0, totalEarnings: 15000,
+ batteryLevel: 0, range: 0, location: 'Service Center'
+ },
+ ];
- const investmentTransactions = transactions.filter((t: any) => t.investorId === investor.id && t.type === 'investment_return');
+ const demoPnl = {
+ grossRevenue: 185000,
+ platformFee: 83250,
+ insurance: 15000,
+ maintenance: 8500,
+ netProfit: 78250,
+ };
+
+ const demoTransactions = [
+ { id: 'tx1', date: '2024-05-15', description: 'Rental Income - Bike AB-1234', amount: 450, status: 'completed' },
+ { id: 'tx2', date: '2024-05-14', description: 'Rental Income - Bike CD-5678', amount: 500, status: 'completed' },
+ { id: 'tx3', date: '2024-05-13', description: 'Rental Income - Bike AB-1234', amount: 450, status: 'completed' },
+ { id: 'tx4', date: '2024-05-12', description: 'Rental Income - Bike EF-9012', amount: 350, status: 'completed' },
+ { id: 'tx5', date: '2024-05-11', description: 'Rental Income - Bike CD-5678', amount: 500, status: 'completed' },
+ { id: 'tx6', date: '2024-05-10', description: 'Withdrawal to Bank', amount: -10000, status: 'completed' },
+ { id: 'tx7', date: '2024-05-09', description: 'Rental Income - Bike AB-1234', amount: 450, status: 'completed' },
+ { id: 'tx8', date: '2024-05-08', description: 'Rental Income - Bike CD-5678', amount: 500, status: 'completed' },
+ ];
return (
-
-
-
-
-
-
-
- {investment.planName}
-
- {investment.planType} Plan
-
-
- {investment.status}
-
+
+
+
+
+
+
+
+
+ {investment.planName}
+
+
+ {investment.planType}
+
+
+ {investment.status}
+
+
+
ID: #{investment.id?.toUpperCase()} • Started: {investment.startDate}
-
- ID: #{investment.id?.toUpperCase()}
- • Started: {investment.startDate}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
Invested
+
Invested
-
৳{investment.totalInvestment.toLocaleString()}
+
৳{(investment.totalInvestment / 1000).toFixed(0)}k
-
-
-
-
+
+
+
+
-
Total Return
+
Total Return
-
৳{investment.actualEarnings.toLocaleString()}
+
৳{(investment.actualEarnings / 1000).toFixed(0)}k
-
-
-
-
+
+
-
৳{(investment.totalInvestment * 0.24 - investment.actualEarnings).toLocaleString()}
+
৳{(investment.totalInvestment * 0.24 - investment.actualEarnings).toLocaleString()}
-
-
-
-
+
+
-
{investment.expectedRoi}%
+
{investment.expectedRoi}%
-
-
-
-
- {['overview', 'bikes', 'pnl', 'transactions'].map((tab) => (
-
setActiveTab(tab)}
- className={`px-6 py-4 text-sm font-bold capitalize transition-colors whitespace-nowrap ${activeTab === tab ? 'text-investor bg-white border-b-2 border-investor' : 'text-slate-500 hover:text-slate-700'}`}
- >
- {tab}
-
+
+
+ {['overview', 'bikes', 'transactions', 'statement'].map((tab) => (
+ setActiveTab(tab)}
+ className={`px-4 lg:px-6 py-3 text-sm font-semibold capitalize whitespace-nowrap transition-colors ${activeTab === tab
+ ? 'text-investor bg-investor/5 border-b-2 border-investor'
+ : 'text-slate-500 hover:text-slate-700 hover:bg-slate-50'
+ }`}
+ >
+ {tab}
+
+ ))}
+
+
+
+ {activeTab === 'overview' && (
+
+
+
+
+ Investment Details
+
+
+
+ Plan Name
+ {investment.planName}
+
+
+ Plan Type
+ {investment.planType}
+
+
+ Period
+ {investment.startDate} - {investment.endDate || 'Ongoing'}
+
+
+ Payment Method
+ {investment.paymentMethod}
+
+
+
+
+
+
+ Plan Policy
+
+
+
+ Min Duration
+ 12 Months
+
+
+ Lock-in Period
+ 3 Months
+
+
+ Exit Penalty
+ 10%
+
+
+ Maintenance
+ Included
+
+
+
+
+
+
+
+ Profit Sharing
+
+
Your share based on rental model
+
+
+
+ )}
+
+ {activeTab === 'bikes' && (
+
+
+
{demoBikes.length} bikes assigned to this investment
+
+ {demoBikes.map((bike) => (
+
+
+

+
+
+
+
{bike.model}
+
+ {bike.status}
+
+
+
{bike.plateNumber} • {bike.brand}
+
+ {bike.batteryLevel}%
+ {bike.range} km
+ {bike.location}
+
+
+
+
Daily Rent
+
৳{bike.currentRent}
+
Total: ৳{bike.totalEarnings.toLocaleString()}
+
+
))}
+ )}
-
- {activeTab === 'overview' && (
-
-
-
-
- Investment Details
-
-
-
- Plan Name
- {investment.planName}
-
-
- Plan Type
- {investment.planType}
-
-
- Period
- {investment.startDate} - {investment.endDate || 'Ongoing'}
-
-
- Payment Method
- {investment.paymentMethod}
-
-
-
-
-
-
- Plan Policy
-
-
-
- Min Duration
- 12 Months
-
-
- Lock-in Period
- 3 Months
-
-
- Exit Penalty
- 10%
-
-
- Maintenance
- Included
-
-
-
-
-
-
-
- Profit Sharing Configuration
-
-
Your share based on rental model
-
-
-
- )}
-
- {activeTab === 'bikes' && (
+ {activeTab === 'statement' && (
+
+
+
Profit & Loss Statement
- {assignedBikes.length > 0 ? assignedBikes.map(bike => (
-
-
-

-
-
-
{bike.model}
-
{bike.plateNumber} • {bike.brand}
-
-
- {bike.status}
-
-
- Daily: ৳{bike.currentRent}
-
-
-
-
-
Total Earnings
-
৳{bike.totalEarnings?.toLocaleString()}
-
- Live Track
-
-
+
+ Gross Rental Revenue
+ ৳{demoPnl.grossRevenue.toLocaleString()}
+
+
+
+ Platform Fee (45%)
+ -৳{demoPnl.platformFee.toLocaleString()}
- )) : (
-
-
-
No bikes assigned yet.
-
Admin will assign bikes to this investment shortly.
+
+ Insurance Coverage
+ -৳{demoPnl.insurance.toLocaleString()}
- )}
-
- )}
-
- {activeTab === 'pnl' && (
-
-
-
Detailed P&L Statement
-
-
- Gross Rental Revenue
- ৳{(investment.actualEarnings / 0.55).toFixed(0)}
-
-
-
- Platform Management Fee (45%)
- -৳{((investment.actualEarnings / 0.55) * 0.45).toFixed(0)}
-
-
- Fleet Insurance & Maintenance
- Included in Platform Fee
-
-
-
- Net Return to Investor
- ৳{investment.actualEarnings.toLocaleString()}
-
+
+ Maintenance
+ -৳{demoPnl.maintenance.toLocaleString()}
+
+ Net Return
+ ৳{demoPnl.netProfit.toLocaleString()}
+
- )}
-
- {activeTab === 'transactions' && (
-
-
-
-
- | Date |
- Description |
- Amount |
- Status |
-
-
-
- {investmentTransactions.map(t => (
-
- | {t.createdAt} |
-
- {t.description}
- Ref: {t.id}
- |
-
- +৳{t.amount.toLocaleString()}
- |
-
-
- Completed
-
- |
-
- ))}
-
-
-
- )}
+
-
-
+ )}
-
-
-
- Quick Actions
-
-
-
toast.success('Printing report...')} className="w-full px-4 py-3 border border-slate-200 text-slate-700 rounded-xl text-sm font-bold hover:bg-slate-50 flex items-center gap-3 transition-all">
- Print Summary
-
-
toast.success('Exporting to Excel...')} className="w-full px-4 py-3 border border-slate-200 text-slate-700 rounded-xl text-sm font-bold hover:bg-slate-50 flex items-center gap-3 transition-all">
- Export Data
-
-
router.push('/investor/withdraw')} className="w-full px-4 py-3 bg-investor text-white rounded-xl text-sm font-bold hover:bg-investor-dark flex items-center gap-3 shadow-md shadow-investor/20 transition-all">
- Withdraw Earnings
-
+ {activeTab === 'transactions' && (
+
+
+
+
+ | Date |
+ Description |
+ Amount |
+ Status |
+
+
+
+ {demoTransactions.map((tx) => (
+
+ | {tx.date} |
+
+ {tx.description}
+ Ref: {tx.id}
+ |
+ 0 ? 'text-green-600' : 'text-red-500'}`}>
+ {tx.amount > 0 ? '+' : ''}৳{tx.amount.toLocaleString()}
+ |
+
+
+ {tx.status}
+
+ |
+
+ ))}
+
+
-
-
-
-
- Support Desk
-
-
- Need help with this investment or bike assignment? Our team is available 24/7.
-
-
toast.success('Connecting to support...')} className="w-full py-2.5 bg-blue-600 text-white rounded-xl font-bold text-sm hover:bg-blue-700 transition-colors">
- Contact Support
-
-
+ )}
);
-}
+}
\ No newline at end of file