refactor: rename investment plans to EV investment plans across UI components
This commit is contained in:
@@ -485,7 +485,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
{activeTab === 'investments' && (
|
{activeTab === 'investments' && (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="font-semibold text-slate-800">Investment Plans</h3>
|
<h3 className="font-semibold text-slate-800">EV Investment Plans</h3>
|
||||||
<button onClick={() => setShowCreateInvestmentModal(true)} className="py-2 px-3 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark flex items-center gap-1">
|
<button onClick={() => setShowCreateInvestmentModal(true)} className="py-2 px-3 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark flex items-center gap-1">
|
||||||
<Plus className="w-4 h-4" /> Add Investment
|
<Plus className="w-4 h-4" /> Add Investment
|
||||||
</button>
|
</button>
|
||||||
@@ -767,20 +767,18 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
{investorTransactions.map(tx => (
|
{investorTransactions.map(tx => (
|
||||||
<div key={tx.id} className="flex items-center justify-between p-3 bg-slate-50 rounded-lg">
|
<div key={tx.id} className="flex items-center justify-between p-3 bg-slate-50 rounded-lg">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${
|
<div className={`w-10 h-10 rounded-full flex items-center justify-center ${tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' ? 'bg-green-100' :
|
||||||
tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' ? 'bg-green-100' :
|
|
||||||
tx.type === 'withdrawal' ? 'bg-red-100' :
|
tx.type === 'withdrawal' ? 'bg-red-100' :
|
||||||
tx.type === 'investment' ? 'bg-purple-100' :
|
tx.type === 'investment' ? 'bg-purple-100' :
|
||||||
tx.type === 'referral_bonus' ? 'bg-yellow-100' :
|
tx.type === 'referral_bonus' ? 'bg-yellow-100' :
|
||||||
tx.type === 'adjustment' || tx.type === 'penalty' ? 'bg-orange-100' : 'bg-blue-100'
|
tx.type === 'adjustment' || tx.type === 'penalty' ? 'bg-orange-100' : 'bg-blue-100'
|
||||||
}`}>
|
}`}>
|
||||||
<DollarSign className={`w-5 h-5 ${
|
<DollarSign className={`w-5 h-5 ${tx.type === 'earning' || tx.type === 'bike_earning' ? 'text-green-600' :
|
||||||
tx.type === 'earning' || tx.type === 'bike_earning' ? 'text-green-600' :
|
|
||||||
tx.type === 'withdrawal' ? 'text-red-600' :
|
tx.type === 'withdrawal' ? 'text-red-600' :
|
||||||
tx.type === 'investment' ? 'text-purple-600' :
|
tx.type === 'investment' ? 'text-purple-600' :
|
||||||
tx.type === 'referral_bonus' ? 'text-yellow-600' :
|
tx.type === 'referral_bonus' ? 'text-yellow-600' :
|
||||||
tx.type === 'adjustment' || tx.type === 'penalty' ? 'text-orange-600' : 'text-blue-600'
|
tx.type === 'adjustment' || tx.type === 'penalty' ? 'text-orange-600' : 'text-blue-600'
|
||||||
}`} />
|
}`} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-medium text-slate-700">{tx.description}</p>
|
<p className="text-sm font-medium text-slate-700">{tx.description}</p>
|
||||||
@@ -840,17 +838,15 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-right">
|
<div className="text-right">
|
||||||
<p className={`text-sm font-medium ${
|
<p className={`text-sm font-medium ${tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' || tx.type === 'referral_bonus' ? 'text-green-600' :
|
||||||
tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' || tx.type === 'referral_bonus' ? 'text-green-600' :
|
|
||||||
tx.type === 'withdrawal' || tx.type === 'penalty' || tx.type === 'adjustment' ? 'text-red-600' : 'text-blue-600'
|
tx.type === 'withdrawal' || tx.type === 'penalty' || tx.type === 'adjustment' ? 'text-red-600' : 'text-blue-600'
|
||||||
}`}>
|
}`}>
|
||||||
{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.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()}
|
||||||
</p>
|
</p>
|
||||||
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${
|
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${tx.status === 'completed' ? 'bg-green-100 text-green-700' :
|
||||||
tx.status === 'completed' ? 'bg-green-100 text-green-700' :
|
|
||||||
tx.status === 'pending' ? 'bg-amber-100 text-amber-700' :
|
tx.status === 'pending' ? 'bg-amber-100 text-amber-700' :
|
||||||
tx.status === 'cancelled' ? 'bg-red-100 text-red-700' : 'bg-slate-100 text-slate-700'
|
tx.status === 'cancelled' ? 'bg-red-100 text-red-700' : 'bg-slate-100 text-slate-700'
|
||||||
}`}>
|
}`}>
|
||||||
{tx.status}
|
{tx.status}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -880,18 +876,16 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
{investor.kycDocuments?.map((doc, idx) => (
|
{investor.kycDocuments?.map((doc, idx) => (
|
||||||
<div key={idx} className="flex items-center justify-between p-4 bg-slate-50 rounded-lg">
|
<div key={idx} className="flex items-center justify-between p-4 bg-slate-50 rounded-lg">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className={`w-12 h-12 rounded-lg flex items-center justify-center ${
|
<div className={`w-12 h-12 rounded-lg flex items-center justify-center ${doc.type === 'nid' ? 'bg-blue-100' :
|
||||||
doc.type === 'nid' ? 'bg-blue-100' :
|
|
||||||
doc.type === 'passport' ? 'bg-purple-100' :
|
doc.type === 'passport' ? 'bg-purple-100' :
|
||||||
doc.type === 'bank_statement' ? 'bg-green-100' :
|
doc.type === 'bank_statement' ? 'bg-green-100' :
|
||||||
doc.type === 'tin_certificate' ? 'bg-amber-100' : 'bg-slate-100'
|
doc.type === 'tin_certificate' ? 'bg-amber-100' : 'bg-slate-100'
|
||||||
}`}>
|
}`}>
|
||||||
<FileText className={`w-6 h-6 ${
|
<FileText className={`w-6 h-6 ${doc.type === 'nid' ? 'text-blue-600' :
|
||||||
doc.type === 'nid' ? 'text-blue-600' :
|
|
||||||
doc.type === 'passport' ? 'text-purple-600' :
|
doc.type === 'passport' ? 'text-purple-600' :
|
||||||
doc.type === 'bank_statement' ? 'text-green-600' :
|
doc.type === 'bank_statement' ? 'text-green-600' :
|
||||||
doc.type === 'tin_certificate' ? 'text-amber-600' : 'text-slate-600'
|
doc.type === 'tin_certificate' ? 'text-amber-600' : 'text-slate-600'
|
||||||
}`} />
|
}`} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-medium text-slate-700 capitalize">{doc.type.replace('_', ' ')}</p>
|
<p className="text-sm font-medium text-slate-700 capitalize">{doc.type.replace('_', ' ')}</p>
|
||||||
@@ -911,7 +905,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
<button onClick={() => alert('Edit document')} className="p-2 hover:bg-slate-200 rounded-lg">
|
<button onClick={() => alert('Edit document')} className="p-2 hover:bg-slate-200 rounded-lg">
|
||||||
<Edit className="w-4 h-4 text-slate-400" />
|
<Edit className="w-4 h-4 text-slate-400" />
|
||||||
</button>
|
</button>
|
||||||
<button onClick={() => { if(confirm('Delete this document?')) alert('Document deleted'); }} className="p-2 hover:bg-red-50 rounded-lg">
|
<button onClick={() => { if (confirm('Delete this document?')) alert('Document deleted'); }} className="p-2 hover:bg-red-50 rounded-lg">
|
||||||
<Trash2 className="w-4 h-4 text-red-400" />
|
<Trash2 className="w-4 h-4 text-red-400" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -931,8 +925,8 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
{investor.kycStatus === 'verified'
|
{investor.kycStatus === 'verified'
|
||||||
? 'All documents have been verified. Investor is fully verified.'
|
? 'All documents have been verified. Investor is fully verified.'
|
||||||
: investor.kycStatus === 'pending'
|
: investor.kycStatus === 'pending'
|
||||||
? 'Documents are under review. Verification typically takes 24-48 hours.'
|
? 'Documents are under review. Verification typically takes 24-48 hours.'
|
||||||
: 'Please upload required documents for verification.'}
|
: 'Please upload required documents for verification.'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1456,10 +1450,9 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
|
|||||||
|
|
||||||
<div className="flex justify-between mb-2">
|
<div className="flex justify-between mb-2">
|
||||||
<span className="text-xs text-slate-500">Status</span>
|
<span className="text-xs text-slate-500">Status</span>
|
||||||
<span className={`text-xs px-2 py-1 rounded-full ${
|
<span className={`text-xs px-2 py-1 rounded-full ${selectedInvoice.status === 'completed' ? 'bg-green-100 text-green-700' :
|
||||||
selectedInvoice.status === 'completed' ? 'bg-green-100 text-green-700' :
|
|
||||||
selectedInvoice.status === 'pending' ? 'bg-amber-100 text-amber-700' : 'bg-slate-100 text-slate-700'
|
selectedInvoice.status === 'pending' ? 'bg-amber-100 text-amber-700' : 'bg-slate-100 text-slate-700'
|
||||||
}`}>
|
}`}>
|
||||||
{selectedInvoice.status}
|
{selectedInvoice.status}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -946,7 +946,7 @@ export default function InvestorDetailPage() {
|
|||||||
<div className="flex items-center justify-between mb-4">
|
<div className="flex items-center justify-between mb-4">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-semibold text-slate-800">Assigned Bikes</h3>
|
<h3 className="font-semibold text-slate-800">Assigned Bikes</h3>
|
||||||
<p className="text-sm text-slate-500">{assignedBikes.length} bikes across {investor.investments?.length || 0} investment plans</p>
|
<p className="text-sm text-slate-500">{assignedBikes.length} bikes across {investor.investments?.length || 0} EV Investment Plans</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||||
@@ -1060,7 +1060,7 @@ export default function InvestorDetailPage() {
|
|||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-semibold text-slate-800">Investment Plans</h3>
|
<h3 className="font-semibold text-slate-800">EV Investment Plans</h3>
|
||||||
<p className="text-sm text-slate-500">Manage investment portfolios for this investor</p>
|
<p className="text-sm text-slate-500">Manage investment portfolios for this investor</p>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={() => setShowCreateInvestmentModal(true)} className="py-2 px-4 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark flex items-center gap-2">
|
<button onClick={() => setShowCreateInvestmentModal(true)} className="py-2 px-4 bg-investor text-white rounded-lg text-sm font-medium hover:bg-investor-dark flex items-center gap-2">
|
||||||
@@ -1871,7 +1871,7 @@ export default function InvestorDetailPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h4 className="font-semibold text-slate-800 mb-3">Select Investment Plans & Bikes</h4>
|
<h4 className="font-semibold text-slate-800 mb-3">Select EV Investment Plans & Bikes</h4>
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center gap-3 p-4 bg-slate-50 rounded-lg border border-slate-200">
|
<div className="flex items-center gap-3 p-4 bg-slate-50 rounded-lg border border-slate-200">
|
||||||
<input
|
<input
|
||||||
@@ -1896,7 +1896,7 @@ export default function InvestorDetailPage() {
|
|||||||
|
|
||||||
<div className="border border-slate-200 rounded-lg overflow-hidden">
|
<div className="border border-slate-200 rounded-lg overflow-hidden">
|
||||||
<div className="bg-slate-50 px-4 py-2 border-b border-slate-200">
|
<div className="bg-slate-50 px-4 py-2 border-b border-slate-200">
|
||||||
<p className="text-sm font-medium text-slate-700">Investment Plans</p>
|
<p className="text-sm font-medium text-slate-700">EV Investment Plans</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="divide-y divide-slate-100">
|
<div className="divide-y divide-slate-100">
|
||||||
{investor.investments?.map((inv: any) => {
|
{investor.investments?.map((inv: any) => {
|
||||||
|
|||||||
@@ -68,14 +68,14 @@ export default function BatteryInvestmentSettings({
|
|||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-lg font-semibold text-slate-800 flex items-center gap-2">
|
<h3 className="text-lg font-semibold text-slate-800 flex items-center gap-2">
|
||||||
<Battery className="w-5 h-5 text-emerald-600 animate-pulse" />
|
<Battery className="w-5 h-5 text-emerald-600 animate-pulse" />
|
||||||
Battery Investment Plans
|
Battery EV Investment Plans
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between bg-emerald-50 border border-emerald-200 rounded-xl p-4">
|
<div className="flex items-center justify-between bg-emerald-50 border border-emerald-200 rounded-xl p-4">
|
||||||
<div>
|
<div>
|
||||||
<h4 className="font-semibold text-emerald-800">Battery Investment Plans ({(settings.plans as any).batteryInvestment?.length || 0})</h4>
|
<h4 className="font-semibold text-emerald-800">Battery EV Investment Plans ({(settings.plans as any).batteryInvestment?.length || 0})</h4>
|
||||||
<p className="text-sm text-emerald-600">Manage high-yield battery pack investment plans for partners</p>
|
<p className="text-sm text-emerald-600">Manage high-yield battery pack EV Investment Plans for partners</p>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={() => { setAddBatteryPlan(true); setNewBatteryName(''); }} className="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm font-medium flex items-center gap-2 hover:bg-emerald-700 transition-colors">
|
<button onClick={() => { setAddBatteryPlan(true); setNewBatteryName(''); }} className="px-4 py-2 bg-emerald-600 text-white rounded-lg text-sm font-medium flex items-center gap-2 hover:bg-emerald-700 transition-colors">
|
||||||
<Plus className="w-4 h-4" /> New Plan
|
<Plus className="w-4 h-4" /> New Plan
|
||||||
|
|||||||
@@ -72,13 +72,13 @@ export default function InvestmentSettings({
|
|||||||
return (
|
return (
|
||||||
<div className="p-6 space-y-6">
|
<div className="p-6 space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-lg font-semibold text-slate-800">Investment Plans</h3>
|
<h3 className="text-lg font-semibold text-slate-800">EV Investment Plans</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between bg-amber-50 border border-amber-200 rounded-xl p-4">
|
<div className="flex items-center justify-between bg-amber-50 border border-amber-200 rounded-xl p-4">
|
||||||
<div>
|
<div>
|
||||||
<h4 className="font-semibold text-amber-800">Investment Plans ({settings.plans.investment.length})</h4>
|
<h4 className="font-semibold text-amber-800">EV Investment Plans ({settings.plans.investment.length})</h4>
|
||||||
<p className="text-sm text-amber-600">Manage investment plans for investors</p>
|
<p className="text-sm text-amber-600">Manage EV Investment Plans for investors</p>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={() => { setAddInvestPlan(true); setNewInvestName(''); }} className="px-4 py-2 bg-amber-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
|
<button onClick={() => { setAddInvestPlan(true); setNewInvestName(''); }} className="px-4 py-2 bg-amber-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
|
||||||
<Plus className="w-4 h-4" /> New Plan
|
<Plus className="w-4 h-4" /> New Plan
|
||||||
|
|||||||
@@ -1229,7 +1229,7 @@ export default function CompanySettingsPage() {
|
|||||||
{ id: 'kyc', label: 'KYC Documents', icon: Package },
|
{ id: 'kyc', label: 'KYC Documents', icon: Package },
|
||||||
|
|
||||||
{ id: 'plans', label: 'Plan Selection', icon: Package },
|
{ id: 'plans', label: 'Plan Selection', icon: Package },
|
||||||
{ id: 'investment', label: 'Bike Investment Plan', icon: DollarSign },
|
{ id: 'investment', label: 'EV Investment Plan', icon: DollarSign },
|
||||||
{ id: 'batteryinvestment', label: 'Battery Investment Plan', icon: Battery },
|
{ id: 'batteryinvestment', label: 'Battery Investment Plan', icon: Battery },
|
||||||
{ id: 'swapstation', label: 'Swap Station Plan (P3)', icon: Zap },
|
{ id: 'swapstation', label: 'Swap Station Plan (P3)', icon: Zap },
|
||||||
{ id: 'riderrequest', label: 'Rider Request Plan (P2)', icon: Users },
|
{ id: 'riderrequest', label: 'Rider Request Plan (P2)', icon: Users },
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ export default function MyInvestmentsPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Investment Plans Cards */}
|
{/* EV Investment Plans Cards */}
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="font-semibold text-slate-800">Investment Plans</h3>
|
<h3 className="font-semibold text-slate-800">EV Investment Plans</h3>
|
||||||
<p className="text-sm text-slate-500">Manage investment portfolios for this investor</p>
|
<p className="text-sm text-slate-500">Manage investment portfolios for this investor</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -341,9 +341,9 @@ export default function InvestorWithdrawPage() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Select Investment Plans & Bikes */}
|
{/* Select EV Investment Plans & Bikes */}
|
||||||
<div>
|
<div>
|
||||||
<h4 className="font-semibold text-slate-800 mb-2">Select Investment Plans & Bikes</h4>
|
<h4 className="font-semibold text-slate-800 mb-2">Select EV Investment Plans & Bikes</h4>
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="flex items-center gap-3 p-3 bg-slate-50 rounded-lg border border-slate-200">
|
<div className="flex items-center gap-3 p-3 bg-slate-50 rounded-lg border border-slate-200">
|
||||||
<input
|
<input
|
||||||
@@ -361,7 +361,7 @@ export default function InvestorWithdrawPage() {
|
|||||||
|
|
||||||
<div className="border border-slate-200 rounded-lg overflow-hidden">
|
<div className="border border-slate-200 rounded-lg overflow-hidden">
|
||||||
<div className="bg-slate-100 px-3 py-2 border-b border-slate-200">
|
<div className="bg-slate-100 px-3 py-2 border-b border-slate-200">
|
||||||
<p className="text-sm font-semibold text-slate-700">Investment Plans</p>
|
<p className="text-sm font-semibold text-slate-700">EV Investment Plans</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="divide-y divide-slate-100">
|
<div className="divide-y divide-slate-100">
|
||||||
{investor.investments?.map((inv: any) => {
|
{investor.investments?.map((inv: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user