refactor: rename investment plans to EV investment plans across UI components

This commit is contained in:
sazzadulalambd
2026-05-19 16:20:31 +06:00
parent 5d1a5454c0
commit c6a9fd960e
7 changed files with 93 additions and 100 deletions

View File

@@ -485,7 +485,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
{activeTab === 'investments' && (
<div className="space-y-6">
<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">
<Plus className="w-4 h-4" /> Add Investment
</button>
@@ -767,15 +767,13 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
{investorTransactions.map(tx => (
<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={`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' :
<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 === 'withdrawal' ? 'bg-red-100' :
tx.type === 'investment' ? 'bg-purple-100' :
tx.type === 'referral_bonus' ? 'bg-yellow-100' :
tx.type === 'adjustment' || tx.type === 'penalty' ? 'bg-orange-100' : 'bg-blue-100'
}`}>
<DollarSign className={`w-5 h-5 ${
tx.type === 'earning' || tx.type === 'bike_earning' ? 'text-green-600' :
<DollarSign className={`w-5 h-5 ${tx.type === 'earning' || tx.type === 'bike_earning' ? 'text-green-600' :
tx.type === 'withdrawal' ? 'text-red-600' :
tx.type === 'investment' ? 'text-purple-600' :
tx.type === 'referral_bonus' ? 'text-yellow-600' :
@@ -840,14 +838,12 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
</div>
</div>
<div className="text-right">
<p className={`text-sm font-medium ${
tx.type === 'earning' || tx.type === 'bike_earning' || tx.type === 'investment_return' || tx.type === 'referral_bonus' ? 'text-green-600' :
<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 === '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()}
</p>
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${
tx.status === 'completed' ? 'bg-green-100 text-green-700' :
<span className={`text-xs font-medium px-2 py-0.5 rounded-full ${tx.status === 'completed' ? 'bg-green-100 text-green-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'
}`}>
@@ -880,14 +876,12 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
{investor.kycDocuments?.map((doc, idx) => (
<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={`w-12 h-12 rounded-lg flex items-center justify-center ${
doc.type === 'nid' ? 'bg-blue-100' :
<div className={`w-12 h-12 rounded-lg flex items-center justify-center ${doc.type === 'nid' ? 'bg-blue-100' :
doc.type === 'passport' ? 'bg-purple-100' :
doc.type === 'bank_statement' ? 'bg-green-100' :
doc.type === 'tin_certificate' ? 'bg-amber-100' : 'bg-slate-100'
}`}>
<FileText className={`w-6 h-6 ${
doc.type === 'nid' ? 'text-blue-600' :
<FileText className={`w-6 h-6 ${doc.type === 'nid' ? 'text-blue-600' :
doc.type === 'passport' ? 'text-purple-600' :
doc.type === 'bank_statement' ? 'text-green-600' :
doc.type === 'tin_certificate' ? 'text-amber-600' : 'text-slate-600'
@@ -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">
<Edit className="w-4 h-4 text-slate-400" />
</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" />
</button>
</div>
@@ -1456,8 +1450,7 @@ Credit (Cr): Investor Liability ৳${newInvestment.totalInvestment.toLocaleStri
<div className="flex justify-between mb-2">
<span className="text-xs text-slate-500">Status</span>
<span className={`text-xs px-2 py-1 rounded-full ${
selectedInvoice.status === 'completed' ? 'bg-green-100 text-green-700' :
<span className={`text-xs px-2 py-1 rounded-full ${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}

View File

@@ -946,7 +946,7 @@ export default function InvestorDetailPage() {
<div className="flex items-center justify-between mb-4">
<div>
<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 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="flex items-center justify-between">
<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>
</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">
@@ -1871,7 +1871,7 @@ export default function InvestorDetailPage() {
</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="flex items-center gap-3 p-4 bg-slate-50 rounded-lg border border-slate-200">
<input
@@ -1896,7 +1896,7 @@ export default function InvestorDetailPage() {
<div className="border border-slate-200 rounded-lg overflow-hidden">
<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 className="divide-y divide-slate-100">
{investor.investments?.map((inv: any) => {

View File

@@ -68,14 +68,14 @@ export default function BatteryInvestmentSettings({
<div className="flex items-center justify-between">
<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 Investment Plans
Battery EV Investment Plans
</h3>
</div>
<div className="flex items-center justify-between bg-emerald-50 border border-emerald-200 rounded-xl p-4">
<div>
<h4 className="font-semibold text-emerald-800">Battery 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>
<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 EV Investment Plans for partners</p>
</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">
<Plus className="w-4 h-4" /> New Plan

View File

@@ -72,13 +72,13 @@ export default function InvestmentSettings({
return (
<div className="p-6 space-y-6">
<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 className="flex items-center justify-between bg-amber-50 border border-amber-200 rounded-xl p-4">
<div>
<h4 className="font-semibold text-amber-800">Investment Plans ({settings.plans.investment.length})</h4>
<p className="text-sm text-amber-600">Manage investment plans for investors</p>
<h4 className="font-semibold text-amber-800">EV Investment Plans ({settings.plans.investment.length})</h4>
<p className="text-sm text-amber-600">Manage EV Investment Plans for investors</p>
</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">
<Plus className="w-4 h-4" /> New Plan

View File

@@ -1229,7 +1229,7 @@ export default function CompanySettingsPage() {
{ id: 'kyc', label: 'KYC Documents', 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: 'swapstation', label: 'Swap Station Plan (P3)', icon: Zap },
{ id: 'riderrequest', label: 'Rider Request Plan (P2)', icon: Users },

View File

@@ -69,11 +69,11 @@ export default function MyInvestmentsPage() {
</div>
</div>
{/* Investment Plans Cards */}
{/* EV Investment Plans Cards */}
<div className="space-y-6">
<div className="flex items-center justify-between">
<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>
</div>
</div>

View File

@@ -341,9 +341,9 @@ export default function InvestorWithdrawPage() {
</div>
</div>
{/* Select Investment Plans & Bikes */}
{/* Select EV Investment Plans & Bikes */}
<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="flex items-center gap-3 p-3 bg-slate-50 rounded-lg border border-slate-200">
<input
@@ -361,7 +361,7 @@ export default function InvestorWithdrawPage() {
<div className="border border-slate-200 rounded-lg overflow-hidden">
<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 className="divide-y divide-slate-100">
{investor.investments?.map((inv: any) => {