diff --git a/src/app/admin/settings/page.tsx b/src/app/admin/settings/page.tsx
index 26a4bba..923d75c 100644
--- a/src/app/admin/settings/page.tsx
+++ b/src/app/admin/settings/page.tsx
@@ -350,61 +350,67 @@ const initialSettings: CompanySettings = {
{ id: 'SC-002', name: 'JAIBEN Service Center - Banani', address: 'Road 11, Banani, Dhaka', phone: '+8801712345671', rating: 4.5 },
],
companyPolicy: {
- investor: {
- title: 'Investor Policy',
- description: '
Investor Guidelines Welcome to our investor program. This document outlines the terms and conditions for all investors participating in our EV fleet sharing initiative.
Key Requirements All investors must complete KYC verification Minimum investment amount: ৳100,000 Monthly returns are calculated based on fleet utilization Note: Past performance does not guarantee future results. Please read all terms carefully before investing.
',
+ investor: {
+ title: 'Investor Policy',
+ description: 'Investor Guidelines Welcome to our investor program. This document outlines the terms and conditions for all investors participating in our EV fleet sharing initiative.
Key Requirements All investors must complete KYC verification Minimum investment amount: ৳100,000 Monthly returns are calculated based on fleet utilization Note: Past performance does not guarantee future results. Please read all terms carefully before investing.
',
rules: [
{ name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle in the fleet' },
{ name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level as when rented' },
{ name: 'No unauthorized drivers', description: 'Only authorized drivers listed in the agreement are permitted to drive' },
{ name: 'Follow traffic rules', description: 'All traffic laws and regulations must be followed' },
{ name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours of occurrence' }
- ]
+ ]
},
- merchant: {
- title: 'Merchant Policy',
- description: 'Merchant Terms & Conditions Thank you for joining our merchant network. These guidelines ensure smooth operations for all participating merchants.
Operational Requirements Maintain minimum inventory levels Provide excellent customer service Accept all payment methods offered Process orders within 24 hours Commission Structure Merchants receive 15% commission on each completed delivery plus monthly bonuses for high performance.
',
+ merchant: {
+ title: 'Merchant Policy',
+ description: 'Merchant Terms & Conditions Thank you for joining our merchant network. These guidelines ensure smooth operations for all participating merchants.
Operational Requirements Maintain minimum inventory levels Provide excellent customer service Accept all payment methods offered Process orders within 24 hours Commission Structure Merchants receive 15% commission on each completed delivery plus monthly bonuses for high performance.
',
rules: [
{ name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle in the fleet' },
{ name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level as when rented' },
{ name: 'No unauthorized drivers', description: 'Only authorized drivers listed in the agreement are permitted to drive' },
{ name: 'Follow traffic rules', description: 'All traffic laws and regulations must be followed' },
{ name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours of occurrence' }
- ]
+ ]
},
- swapStation: {
- title: 'Swap Station Policy',
- description: 'Swap Station Guidelines Welcome to our battery swap station network. Follow these safety and operational protocols for optimal service.
Safety Protocols Always wear protective gloves when handling batteries Inspect batteries for damage before swapping Keep swap station area clean and organized Report any malfunctioning equipment immediately Operating Hours Stations operate 24/7 for subscriber convenience. Emergency support available round the clock.
',
+ swapStation: {
+ title: 'Swap Station Policy',
+ description: 'Swap Station Guidelines Welcome to our battery swap station network. Follow these safety and operational protocols for optimal service.
Safety Protocols Always wear protective gloves when handling batteries Inspect batteries for damage before swapping Keep swap station area clean and organized Report any malfunctioning equipment immediately Operating Hours Stations operate 24/7 for subscriber convenience. Emergency support available round the clock.
',
rules: [
{ name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle in the fleet' },
{ name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level as when rented' },
{ name: 'No unauthorized drivers', description: 'Only authorized drivers listed in the agreement are permitted to drive' },
{ name: 'Follow traffic rules', description: 'All traffic laws and regulations must be followed' },
{ name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours of occurrence' }
- ]
+ ]
},
rentalTypes: [
- { type: 'single', name: 'Rental (Single)', title: 'Rental (Single)', description: 'Single Person Rental Perfect for individual riders who need a reliable vehicle for daily commute or delivery work.
Plan Features Daily, weekly, and monthly options available Comprehensive insurance included 24/7 roadside assistance Free maintenance during rental period Pricing Starting from ৳400/day with deposit of ৳5,000.
', rules: [
- { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
- { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
- { name: 'No unauthorized drivers', description: 'Only the registered rider is permitted to drive' },
- { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
- { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
- ], enabled: true },
- { type: 'shared', name: 'Rental (2 Person Shared)', title: 'Rental (2 Person Shared)', description: 'Shared Rental Plan Ideal for companions or delivery partners who want to share riding costs and responsibilities.
Plan Features Split costs between two riders Both users must be verified Shared liability coverage Flexible switch driver feature Pricing Starting from ৳600/day (৳300 each) with deposit of ৳8,000.
', rules: [
- { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
- { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
- { name: 'No unauthorized drivers', description: 'Both registered riders are permitted to drive' },
- { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
- { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
- ], enabled: true },
- { type: 'renttoown', name: 'Rent-to-Own', title: 'Rent-to-Own', description: 'Rent-to-Own Plan Build ownership gradually with our rent-to-own program. After completing the tenure, own the EV outright.
Program Benefits 50% of rental payments go toward purchase Option to buyout anytime Full ownership after 36 months Transferable to family members Requirements Good payment history required. Credit check applies.
', rules: [
- { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
- { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
- { name: 'No unauthorized drivers', description: 'Only the registered rider is permitted to drive' },
- { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
- { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
- ], enabled: true },
+ {
+ type: 'single', name: 'Rental (Single)', title: 'Rental (Single)', description: 'Single Person Rental Perfect for individual riders who need a reliable vehicle for daily commute or delivery work.
Plan Features Daily, weekly, and monthly options available Comprehensive insurance included 24/7 roadside assistance Free maintenance during rental period Pricing Starting from ৳400/day with deposit of ৳5,000.
', rules: [
+ { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
+ { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
+ { name: 'No unauthorized drivers', description: 'Only the registered rider is permitted to drive' },
+ { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
+ { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
+ ], enabled: true
+ },
+ {
+ type: 'shared', name: 'Rental (2 Person Shared)', title: 'Rental (2 Person Shared)', description: 'Shared Rental Plan Ideal for companions or delivery partners who want to share riding costs and responsibilities.
Plan Features Split costs between two riders Both users must be verified Shared liability coverage Flexible switch driver feature Pricing Starting from ৳600/day (৳300 each) with deposit of ৳8,000.
', rules: [
+ { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
+ { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
+ { name: 'No unauthorized drivers', description: 'Both registered riders are permitted to drive' },
+ { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
+ { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
+ ], enabled: true
+ },
+ {
+ type: 'renttoown', name: 'Rent-to-Own', title: 'Rent-to-Own', description: 'Rent-to-Own Plan Build ownership gradually with our rent-to-own program. After completing the tenure, own the EV outright.
Program Benefits 50% of rental payments go toward purchase Option to buyout anytime Full ownership after 36 months Transferable to family members Requirements Good payment history required. Credit check applies.
', rules: [
+ { name: 'No smoking in vehicles', description: 'Smoking is strictly prohibited inside any vehicle' },
+ { name: 'Return with same fuel/charge level', description: 'Vehicles must be returned with the same fuel/charge level' },
+ { name: 'No unauthorized drivers', description: 'Only the registered rider is permitted to drive' },
+ { name: 'Follow traffic rules', description: 'All traffic laws must be followed' },
+ { name: 'Report accidents within 24 hours', description: 'Any accident must be reported within 24 hours' }
+ ], enabled: true
+ },
],
},
rentalPolicy: {
@@ -676,7 +682,7 @@ export default function CompanySettingsPage() {
const [newDocName, setNewDocName] = useState('');
const [newDocDesc, setNewDocDesc] = useState('');
const [activeInvestTab, setActiveInvestTab] = useState(0);
- const [editingPolicy, setEditingPolicy] = useState<{tab: string; index: number} | null>(null);
+ const [editingPolicy, setEditingPolicy] = useState<{ tab: string; index: number } | null>(null);
const [editPolicyName, setEditPolicyName] = useState('');
const [editPolicyDesc, setEditPolicyDesc] = useState('');
const [editPolicyDescHtml, setEditPolicyDescHtml] = useState('');
@@ -760,7 +766,7 @@ export default function CompanySettingsPage() {
setSettings({ ...settings, plans: { ...settings.plans, swapStation: updatedPlans } });
setActiveSwapTab(updatedPlans.length - 1);
setAddSwapStationPlan(false);
-setNewSwapName('');
+ setNewSwapName('');
}
};
const [activeRiderTab, setActiveRiderTab] = useState(0);
@@ -1869,7 +1875,7 @@ setNewSwapName('');
Company's Policy
-
+
setActiveMasterTab('investor')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeMasterTab === 'investor' ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>Investor
setActiveMasterTab('merchant')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeMasterTab === 'merchant' ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>Merchant
setActiveMasterTab('swapstation')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeMasterTab === 'swapstation' ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>Swap Station
@@ -1878,294 +1884,251 @@ setNewSwapName('');
{activeMasterTab === 'investor' && (
-
-
Policy Title
-
setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, investor: { title: e.target.value, description: settings.companyPolicy?.investor?.description || '', rules: settings.companyPolicy?.investor?.rules || [] } } })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+
Policy List
+
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
+ Add Policy
+
-
- Policy Description
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, investor: { title: settings.companyPolicy?.investor?.title || '', description: val, rules: settings.companyPolicy?.investor?.rules || [] } } })} placeholder="Enter policy description..." minHeight={160} />
-
-
- Save Changes
-
-
-
-
Policy List
-
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
- Add Policy
-
-
-
- {(settings.companyPolicy?.investor?.rules || []).map((policy, i) => (
-
- {editingPolicy?.tab === 'investor' && editingPolicy?.index === i ? (
-
-
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
-
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
-
- { updatePolicyRule('investor', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
- { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+ {(settings.companyPolicy?.investor?.rules || []).map((policy, i) => (
+
+ {editingPolicy?.tab === 'investor' && editingPolicy?.index === i ? (
+
+
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
+
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
+
+ { updatePolicyRule('investor', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
+ { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
- ) : (
-
-
-
- {policy.name}
-
-
{policy.description}
-
-
-
{ setEditingPolicy({ tab: 'investor', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
-
-
-
deletePolicyRule('investor', i)} className="p-1 text-slate-400 hover:text-red-600">
-
-
+
+ ) : (
+
+
+
+ {policy.name}
+
{policy.description}
- )}
-
- ))}
-
- {showAddPolicy && (
-
-
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
-
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
-
- addPolicyRule('investor')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
- { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+
{ setEditingPolicy({ tab: 'investor', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
+
+
+
deletePolicyRule('investor', i)} className="p-1 text-slate-400 hover:text-red-600">
+
+
+
+
+ )}
- )}
+ ))}
+ {showAddPolicy && (
+
+
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
+
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
+
+ addPolicyRule('investor')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
+ { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
+
+
+ )}
+
)}
{activeMasterTab === 'merchant' && (
-
-
Policy Title
-
setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, merchant: { title: e.target.value, description: settings.companyPolicy?.merchant?.description || '', rules: settings.companyPolicy?.merchant?.rules || [] } } })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+
Policy List
+
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
+ Add Policy
+
-
- Policy Description
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, merchant: { title: settings.companyPolicy?.merchant?.title || '', description: val, rules: settings.companyPolicy?.merchant?.rules || [] } } })} placeholder="Enter policy description..." minHeight={160} />
-
-
- Save Changes
-
-
-
-
Policy List
-
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
- Add Policy
-
-
-
- {(settings.companyPolicy?.merchant?.rules || []).map((policy, i) => (
-
- {editingPolicy?.tab === 'merchant' && editingPolicy?.index === i ? (
-
-
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
-
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
-
- { updatePolicyRule('merchant', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
- { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+ {(settings.companyPolicy?.merchant?.rules || []).map((policy, i) => (
+
+ {editingPolicy?.tab === 'merchant' && editingPolicy?.index === i ? (
+
+
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
+
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
+
+ { updatePolicyRule('merchant', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
+ { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
- ) : (
-
-
-
- {policy.name}
-
-
{policy.description}
-
-
-
{ setEditingPolicy({ tab: 'merchant', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
-
-
-
deletePolicyRule('merchant', i)} className="p-1 text-slate-400 hover:text-red-600">
-
-
+
+ ) : (
+
+
+
+ {policy.name}
+
{policy.description}
- )}
-
- ))}
-
- {showAddPolicy && (
-
-
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
-
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
-
- addPolicyRule('merchant')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
- { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+
{ setEditingPolicy({ tab: 'merchant', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
+
+
+
deletePolicyRule('merchant', i)} className="p-1 text-slate-400 hover:text-red-600">
+
+
+
+
+ )}
- )}
+ ))}
+ {showAddPolicy && (
+
+
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
+
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
+
+ addPolicyRule('merchant')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
+ { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
+
+
+ )}
+
)}
{activeMasterTab === 'swapstation' && (
-
-
Policy Title
-
setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, swapStation: { title: e.target.value, description: settings.companyPolicy?.swapStation?.description || '', rules: settings.companyPolicy?.swapStation?.rules || [] } } })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+
Policy List
+
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
+ Add Policy
+
-
- Policy Description
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, swapStation: { title: settings.companyPolicy?.swapStation?.title || '', description: val, rules: settings.companyPolicy?.swapStation?.rules || [] } } })} placeholder="Enter policy description..." minHeight={160} />
-
-
- Save Changes
-
-
-
-
Policy List
-
setShowAddPolicy(true)} className="text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
- Add Policy
-
-
-
- {(settings.companyPolicy?.swapStation?.rules || []).map((policy, i) => (
-
- {editingPolicy?.tab === 'swapstation' && editingPolicy?.index === i ? (
-
-
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
-
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
-
- { updatePolicyRule('swapstation', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
- { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+ {(settings.companyPolicy?.swapStation?.rules || []).map((policy, i) => (
+
+ {editingPolicy?.tab === 'swapstation' && editingPolicy?.index === i ? (
+
+
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
+
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
+
+ { updatePolicyRule('swapstation', i); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
+ { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
- ) : (
-
-
-
- {policy.name}
-
-
{policy.description}
-
-
-
{ setEditingPolicy({ tab: 'swapstation', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
-
-
-
deletePolicyRule('swapstation', i)} className="p-1 text-slate-400 hover:text-red-600">
-
-
+
+ ) : (
+
+
+
+ {policy.name}
+
{policy.description}
- )}
-
- ))}
-
- {showAddPolicy && (
-
-
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
-
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
-
- addPolicyRule('swapstation')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
- { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
+
+
{ setEditingPolicy({ tab: 'swapstation', index: i }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
+
+
+
deletePolicyRule('swapstation', i)} className="p-1 text-slate-400 hover:text-red-600">
+
+
+
+
+ )}
- )}
+ ))}
+ {showAddPolicy && (
+
+
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
+
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
+
+ addPolicyRule('swapstation')} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
+ { setShowAddPolicy(false); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
+
+
+ )}
+
)}
{activeMasterTab === 'rentalType' && (
{(settings.companyPolicy?.rentalTypes || []).map((rtype, idx) => (
-
+
{rtype.name}
-
-
{
- const updated = [...(settings.companyPolicy?.rentalTypes || [])];
- updated[idx] = { ...updated[idx], title: e.target.value };
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
- }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm" placeholder="Policy Title" />
-
{
- const updated = [...(settings.companyPolicy?.rentalTypes || [])];
- updated[idx] = { ...updated[idx], description: val };
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
- }} placeholder="Enter policy description..." minHeight={120} />
-
-
- Policy List
-
-
- {(rtype.rules || []).map((policy, policyIdx) => (
-
- {editingPolicy?.tab === 'rentalType' && editingPolicy?.index === policyIdx ? (
-
-
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
-
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
-
- {
- const updated = [...(settings.companyPolicy?.rentalTypes || [])];
- const newDesc = editPolicyDescHtml || editPolicyDesc;
- updated[idx].rules[policyIdx] = { name: editPolicyName, description: newDesc };
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
- setEditingPolicy(null);
- setEditPolicyDescHtml('');
- }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
- { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
-
- ) : (
-
-
-
- {policy.name}
-
-
{policy.description}
-
-
-
{ setEditingPolicy({ tab: 'rentalType', index: policyIdx }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
-
-
-
{
- const updated = [...(settings.companyPolicy?.rentalTypes || [])];
- updated[idx].rules = updated[idx].rules?.filter((_, i) => i !== policyIdx);
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
- }} className="p-1 text-slate-400 hover:text-red-600">
-
-
-
-
- )}
-
- ))}
-
-
setEditingPolicy({ tab: 'rentalTypeAdd', index: idx })} className="mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
- Add Policy
-
- {editingPolicy?.tab === 'rentalTypeAdd' && editingPolicy?.index === idx && (
-
-
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
-
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
-
- {
- const updated = [...(settings.companyPolicy?.rentalTypes || [])];
- updated[idx].rules = [...(updated[idx].rules || []), { name: newPolicyName, description: newPolicyDesc }];
- setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
- setNewPolicyName('');
- setNewPolicyDesc('');
- setEditingPolicy(null);
- }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
- { setEditingPolicy(null); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
-
-
- )}
+
+
+
+ Policy List
+
+ {(rtype.rules || []).map((policy, policyIdx) => (
+
+ {editingPolicy?.tab === 'rentalType' && editingPolicy?.index === policyIdx ? (
+
+
setEditPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm" placeholder="Policy Name" />
+
setEditPolicyDescHtml(val)} placeholder="Policy Description..." minHeight={100} />
+
+ {
+ const updated = [...(settings.companyPolicy?.rentalTypes || [])];
+ const newDesc = editPolicyDescHtml || editPolicyDesc;
+ updated[idx].rules[policyIdx] = { name: editPolicyName, description: newDesc };
+ setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
+ setEditingPolicy(null);
+ setEditPolicyDescHtml('');
+ }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Save
+ { setEditingPolicy(null); setEditPolicyDescHtml(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
+
+
+ ) : (
+
+
+
+ {policy.name}
+
+
{policy.description}
+
+
+
{ setEditingPolicy({ tab: 'rentalType', index: policyIdx }); setEditPolicyName(policy.name); setEditPolicyDesc(policy.description); setEditPolicyDescHtml(policy.description); }} className="p-1 text-slate-400 hover:text-blue-600">
+
+
+
{
+ const updated = [...(settings.companyPolicy?.rentalTypes || [])];
+ updated[idx].rules = updated[idx].rules?.filter((_, i) => i !== policyIdx);
+ setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
+ }} className="p-1 text-slate-400 hover:text-red-600">
+
+
+
+
+ )}
+
+ ))}
+
+
setEditingPolicy({ tab: 'rentalTypeAdd', index: idx })} className="mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1">
+ Add Policy
+
+ {editingPolicy?.tab === 'rentalTypeAdd' && editingPolicy?.index === idx && (
+
+
setNewPolicyName(e.target.value)} className="w-full px-2 py-1.5 border border-slate-200 rounded text-sm mb-2" placeholder="Policy Name" />
+
setNewPolicyDesc(val)} placeholder="Policy Description..." minHeight={100} />
+
+ {
+ const updated = [...(settings.companyPolicy?.rentalTypes || [])];
+ updated[idx].rules = [...(updated[idx].rules || []), { name: newPolicyName, description: newPolicyDesc }];
+ setSettings({ ...settings, companyPolicy: { ...settings.companyPolicy, rentalTypes: updated } });
+ setNewPolicyName('');
+ setNewPolicyDesc('');
+ setEditingPolicy(null);
+ }} className="px-2 py-1 bg-blue-600 text-white rounded text-xs">Add
+ { setEditingPolicy(null); setNewPolicyName(''); setNewPolicyDesc(''); }} className="px-2 py-1 bg-slate-200 text-slate-600 rounded text-xs">Cancel
+
+
+ )}
+
))}
Save Changes
@@ -2173,754 +2136,763 @@ setNewSwapName('');
)}
-)}
+ )
+ }
- {activeTab === 'plans' && (
-
-
-
Plan Selection
-
-
-
- setActivePlanTab('singleRent')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'singleRent' ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>1. Single Rent
- setActivePlanTab('rentToOwn')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'rentToOwn' ? 'border-purple-500 text-purple-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>2. Rent to Own
- setActivePlanTab('shareEv')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'shareEv' ? 'border-green-500 text-green-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>3. Share an EV
-
-
- {activePlanTab === 'singleRent' && (
-
- {settings.plans.singleRent.map((plan, idx) => (
-
-
-
- {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
-
-
SINGLE RENT - {plan.tier} - ৳{plan.dailyRent}/day
-
{plan.description}
-
-
-
- Save
-
-
-
-
-
- Daily Rent (৳)
- { const updated = [...settings.plans.singleRent]; updated[idx].dailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Weekly Subscription (৳)
- { const updated = [...settings.plans.singleRent]; updated[idx].weeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription (৳)
- { const updated = [...settings.plans.singleRent]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Deposit (৳)
- { const updated = [...settings.plans.singleRent]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- FICO Share (%)
- { const updated = [...settings.plans.singleRent]; updated[idx].ficoSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- JAIBEN Keep (%)
-
-
-
-
-
- FICO + JAIBEN =
- {plan.ficoSharePercent + (100 - plan.ficoSharePercent)}% (FICO: {plan.ficoSharePercent}% + JAIBEN: {100 - plan.ficoSharePercent}%)
-
-
-
- Description
-
-
-
- ))}
+ {
+ activeTab === 'plans' && (
+
+
+
Plan Selection
- )}
- {activePlanTab === 'rentToOwn' && (
-
- {settings.plans.rentToOwn.map((plan, idx) => (
-
-
-
- {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
-
-
RENT TO OWN - {plan.tier} - ৳{plan.dailyRent}/day
-
{plan.description}
-
-
-
- Save
-
-
-
-
-
- Daily Rent (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].dailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Weekly Subscription (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].weeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Deposit (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Duration (Months)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].durationMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- EV Price (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].evPrice = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Total Payment (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].totalPayment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Profit (৳)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].profit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- FICO Rent Share (%)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].ficoRentSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- FICO Profit Share (%)
- { const updated = [...settings.plans.rentToOwn]; updated[idx].ficoProfitSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- JAIBEN Keep (%)
-
-
-
-
-
- FICO + JAIBEN =
- {plan.ficoRentSharePercent + plan.ficoProfitSharePercent + (100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent)}% (FICO Rent: {plan.ficoRentSharePercent}% + FICO Profit: {plan.ficoProfitSharePercent}% + JAIBEN: {100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent}%)
-
-
-
- Description
-
-
-
- ))}
+
+ setActivePlanTab('singleRent')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'singleRent' ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>1. Single Rent
+ setActivePlanTab('rentToOwn')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'rentToOwn' ? 'border-purple-500 text-purple-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>2. Rent to Own
+ setActivePlanTab('shareEv')} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activePlanTab === 'shareEv' ? 'border-green-500 text-green-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>3. Share an EV
- )}
- {activePlanTab === 'shareEv' && (
-
- {settings.plans.shareEv.map((plan, idx) => (
-
-
-
- {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
-
-
SHARE AN EV - {plan.tier} - ৳{plan.dailyRentEach}/day each (Total: ৳{plan.totalDailyRent})
-
{plan.description}
+ {activePlanTab === 'singleRent' && (
+
+ {settings.plans.singleRent.map((plan, idx) => (
+
+
+
+ {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
+
+
SINGLE RENT - {plan.tier} - ৳{plan.dailyRent}/day
+
{plan.description}
+
+
+ Save
+
-
- Save
-
-
-
-
-
-
Daily Rent Each (৳)
-
{ const updated = [...settings.plans.shareEv]; updated[idx].dailyRentEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+
+ Daily Rent (৳)
+ { const updated = [...settings.plans.singleRent]; updated[idx].dailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Weekly Subscription (৳)
+ { const updated = [...settings.plans.singleRent]; updated[idx].weeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Subscription (৳)
+ { const updated = [...settings.plans.singleRent]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Deposit (৳)
+ { const updated = [...settings.plans.singleRent]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ FICO Share (%)
+ { const updated = [...settings.plans.singleRent]; updated[idx].ficoSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, singleRent: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ JAIBEN Keep (%)
+
+
-
-
Total Daily Rent (৳)
-
{ const updated = [...settings.plans.shareEv]; updated[idx].totalDailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ FICO + JAIBEN =
+ {plan.ficoSharePercent + (100 - plan.ficoSharePercent)}% (FICO: {plan.ficoSharePercent}% + JAIBEN: {100 - plan.ficoSharePercent}%)
+
-
-
Weekly Subscription Each (৳)
-
{ const updated = [...settings.plans.shareEv]; updated[idx].weeklySubscriptionEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+ Description
+
-
- Total Weekly Subscription (৳)
- { const updated = [...settings.plans.shareEv]; updated[idx].totalWeeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription Each (৳)
- { const updated = [...settings.plans.shareEv]; updated[idx].monthlySubscriptionEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Total Monthly Subscription (৳)
- { const updated = [...settings.plans.shareEv]; updated[idx].totalMonthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Deposit Each (৳)
- { const updated = [...settings.plans.shareEv]; updated[idx].depositEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Total Deposit (৳)
- { const updated = [...settings.plans.shareEv]; updated[idx].totalDeposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- FICO Share (%)
- { const updated = [...settings.plans.shareEv]; updated[idx].ficoSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- JAIBEN Keep (%)
-
-
-
-
-
- FICO + JAIBEN =
- {plan.ficoSharePercent + (100 - plan.ficoSharePercent)}% (FICO: {plan.ficoSharePercent}% + JAIBEN: {100 - plan.ficoSharePercent}%)
-
-
-
- Description
-
-
- ))}
-
- )}
-
- )}
-
- {(activeTab as string) === 'investment' && (
-
-
-
Investment Plans
-
-
-
-
-
Investment Plans ({settings.plans.investment.length})
-
Manage investment plans for investors
-
-
{ setAddInvestPlan(true); setNewInvestName(''); }} className="px-4 py-2 bg-amber-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
- New Plan
-
-
-
- {addInvestPlan && (
-
-
-
-
New Investment Plan
-
Fill in the details below
-
-
setAddInvestPlan(false)} className="text-amber-600 hover:text-amber-800">
-
-
+ ))}
-
-
-
-
- Profit from Plan Selection (FICO Share):
- {settings.plans.singleRent[0]?.ficoSharePercent || 50}%
-
-
-
- Description
-
-
Create Plan
-
-
- )}
+ )}
-
- {settings.plans.investment.map((plan, idx) => (
-
setActiveInvestTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeInvestTab === idx ? 'border-amber-500 text-amber-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}> {plan.name}
- ))}
+ {activePlanTab === 'rentToOwn' && (
+
+ {settings.plans.rentToOwn.map((plan, idx) => (
+
+
+
+ {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
+
+
RENT TO OWN - {plan.tier} - ৳{plan.dailyRent}/day
+
{plan.description}
+
+
+
+ Save
+
+
+
+
+
+ Daily Rent (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].dailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Weekly Subscription (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].weeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Subscription (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Deposit (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Duration (Months)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].durationMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ EV Price (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].evPrice = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Payment (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].totalPayment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Profit (৳)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].profit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ FICO Rent Share (%)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].ficoRentSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ FICO Profit Share (%)
+ { const updated = [...settings.plans.rentToOwn]; updated[idx].ficoProfitSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, rentToOwn: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ JAIBEN Keep (%)
+
+
+
+
+
+ FICO + JAIBEN =
+ {plan.ficoRentSharePercent + plan.ficoProfitSharePercent + (100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent)}% (FICO Rent: {plan.ficoRentSharePercent}% + FICO Profit: {plan.ficoProfitSharePercent}% + JAIBEN: {100 - plan.ficoRentSharePercent - plan.ficoProfitSharePercent}%)
+
+
+
+ Description
+
+
+
+ ))}
+
+ )}
+
+ {activePlanTab === 'shareEv' && (
+
+ {settings.plans.shareEv.map((plan, idx) => (
+
+
+
+ {/*
{plan.tier === 'Premium' ? '👑' : plan.tier === 'Standard' ? '⚖️' : '💰'} */}
+
+
SHARE AN EV - {plan.tier} - ৳{plan.dailyRentEach}/day each (Total: ৳{plan.totalDailyRent})
+
{plan.description}
+
+
+
+ Save
+
+
+
+
+
+ Daily Rent Each (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].dailyRentEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Daily Rent (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].totalDailyRent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Weekly Subscription Each (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].weeklySubscriptionEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Weekly Subscription (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].totalWeeklySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Subscription Each (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].monthlySubscriptionEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Monthly Subscription (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].totalMonthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Deposit Each (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].depositEach = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Deposit (৳)
+ { const updated = [...settings.plans.shareEv]; updated[idx].totalDeposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ FICO Share (%)
+ { const updated = [...settings.plans.shareEv]; updated[idx].ficoSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, shareEv: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ JAIBEN Keep (%)
+
+
+
+
+
+ FICO + JAIBEN =
+ {plan.ficoSharePercent + (100 - plan.ficoSharePercent)}% (FICO: {plan.ficoSharePercent}% + JAIBEN: {100 - plan.ficoSharePercent}%)
+
+
+
+ Description
+
+
+
+ ))}
+
+ )}
+ )
+ }
- {settings.plans.investment.length > 0 && settings.plans.investment.map((plan, idx) => idx === activeInvestTab && (
-
-
-
-
{plan.name} - {plan.monthlyReturnPercent}% per month
-
{plan.description}
-
-
{plan.status}
+ {
+ (activeTab as string) === 'investment' && (
+
+
+
Investment Plans
+
+
+
+
+
Investment Plans ({settings.plans.investment.length})
+
Manage investment plans for investors
-
-
+
{ setAddInvestPlan(true); setNewInvestName(''); }} className="px-4 py-2 bg-amber-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
+ New Plan
+
+
+
+ {addInvestPlan && (
+
+
-
Plan Name
-
{ const updated = [...settings.plans.investment]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
New Investment Plan
+
Fill in the details below
-
- Status
- { const updated = [...settings.plans.investment]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Active
- Paused
- Closed
-
-
-
- Target Amount (৳)
- { const updated = [...settings.plans.investment]; updated[idx].targetAmount = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Start Date
- { const updated = [...settings.plans.investment]; updated[idx].startDate = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- End Date
- { const updated = [...settings.plans.investment]; updated[idx].endDate = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Min Investment (৳)
- { const updated = [...settings.plans.investment]; updated[idx].minInvestment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Max Investment (৳)
- { const updated = [...settings.plans.investment]; updated[idx].maxInvestment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Return (%)
- { const updated = [...settings.plans.investment]; updated[idx].monthlyReturnPercent = parseFloat(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Duration (Months)
- { const updated = [...settings.plans.investment]; updated[idx].durationMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Lock-in Period (Months)
- { const updated = [...settings.plans.investment]; updated[idx].lockInMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Total Return (%)
- { const updated = [...settings.plans.investment]; updated[idx].totalReturnPercent = parseFloat(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Early Exit Penalty (%)
- { const updated = [...settings.plans.investment]; updated[idx].earlyExitPenalty = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
-
-
- Profit from Plan Selection (FICO Share):
- {settings.plans.singleRent[0]?.ficoSharePercent || 50}%
-
-
-
- Description
-
-
-
- Save Changes
+ setAddInvestPlan(false)} className="text-amber-600 hover:text-amber-800">
+
-
-
- ))}
-
- )}
-
- {(activeTab as string) === 'swapstation' && (
-
-
-
Swap Station Plans
-
-
-
-
-
Swap Station Plans ({settings.plans.swapStation.length})
-
Manage swap station plans for operators
-
-
{ setAddSwapStationPlan(true); setNewSwapName(''); }} className="px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
- New Plan
-
-
-
- {addSwapStationPlan && (
-
-
-
-
New Swap Station Plan
-
Fill in the details below
+
+
+
+
+ Profit from Plan Selection (FICO Share):
+ {settings.plans.singleRent[0]?.ficoSharePercent || 50}%
+
+
+
+ Description
+
+
Create Plan
-
setAddSwapStationPlan(false)} className="text-blue-600 hover:text-blue-800">
-
-
-
-
+ )}
+
+
+ {settings.plans.investment.map((plan, idx) => (
+ setActiveInvestTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeInvestTab === idx ? 'border-amber-500 text-amber-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}> {plan.name}
+ ))}
+
+
+ {settings.plans.investment.length > 0 && settings.plans.investment.map((plan, idx) => idx === activeInvestTab && (
+
+
-
Plan Name
-
setNewSwapName(e.target.value)} placeholder="e.g., Standard Station" className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
{plan.name} - {plan.monthlyReturnPercent}% per month
+
{plan.description}
-
- Status
- setNewSwapStatus(e.target.value)} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Active
- Paused
- Closed
-
+ {plan.status}
+
+
+
+
+ Plan Name
+ { const updated = [...settings.plans.investment]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Status
+ { const updated = [...settings.plans.investment]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
+ Active
+ Paused
+ Closed
+
+
+
+ Target Amount (৳)
+ { const updated = [...settings.plans.investment]; updated[idx].targetAmount = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Start Date
+ { const updated = [...settings.plans.investment]; updated[idx].startDate = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ End Date
+ { const updated = [...settings.plans.investment]; updated[idx].endDate = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Min Investment (৳)
+ { const updated = [...settings.plans.investment]; updated[idx].minInvestment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Max Investment (৳)
+ { const updated = [...settings.plans.investment]; updated[idx].maxInvestment = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Return (%)
+ { const updated = [...settings.plans.investment]; updated[idx].monthlyReturnPercent = parseFloat(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Duration (Months)
+ { const updated = [...settings.plans.investment]; updated[idx].durationMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Lock-in Period (Months)
+ { const updated = [...settings.plans.investment]; updated[idx].lockInMonths = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Total Return (%)
+ { const updated = [...settings.plans.investment]; updated[idx].totalReturnPercent = parseFloat(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Early Exit Penalty (%)
+ { const updated = [...settings.plans.investment]; updated[idx].earlyExitPenalty = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, investment: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
-
-
Battery Count
-
setNewSwapBatteryCount(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Profit from Plan Selection (FICO Share):
+ {settings.plans.singleRent[0]?.ficoSharePercent || 50}%
+
-
-
Swap Price (৳)
-
setNewSwapPrice(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+ Description
+
-
- Monthly Subscription (৳)
- setNewSwapMonthly(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Subscription (৳)
- setNewSwapDaily(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Min Batteries
- setNewSwapMin(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Max Batteries
- setNewSwapMax(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
-
Profit Share (%)
-
setNewSwapProfit(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Save Changes
+
-
- Description
-
-
Create Plan
-
- )}
-
-
- {settings.plans.swapStation.map((plan, idx) => (
- setActiveSwapTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeSwapTab === idx ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}> {plan.name}
))}
+ )
+ }
- {settings.plans.swapStation.length > 0 && settings.plans.swapStation.map((plan, idx) => idx === activeSwapTab && (
-
-
-
-
{plan.name}
-
{plan.description}
-
-
{plan.status}
+ {
+ (activeTab as string) === 'swapstation' && (
+
+
+
Swap Station Plans
+
+
+
+
+
Swap Station Plans ({settings.plans.swapStation.length})
+
Manage swap station plans for operators
-
-
+
{ setAddSwapStationPlan(true); setNewSwapName(''); }} className="px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
+ New Plan
+
+
+
+ {addSwapStationPlan && (
+
+
-
Plan Name
-
{ const updated = [...settings.plans.swapStation]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
New Swap Station Plan
+
Fill in the details below
-
- Status
- { const updated = [...settings.plans.swapStation]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Active
- Paused
- Closed
-
-
-
- Battery Count
- { const updated = [...settings.plans.swapStation]; updated[idx].batteryCount = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Swap Price (৳)
- { const updated = [...settings.plans.swapStation]; updated[idx].swapPrice = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription (৳)
- { const updated = [...settings.plans.swapStation]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Subscription (৳)
- { const updated = [...settings.plans.swapStation]; updated[idx].dailySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Min Batteries
- { const updated = [...settings.plans.swapStation]; updated[idx].minBatteries = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Max Batteries
- { const updated = [...settings.plans.swapStation]; updated[idx].maxBatteries = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Profit Share (%)
- { const updated = [...settings.plans.swapStation]; updated[idx].profitSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
-
- Description
-
-
-
- Save Changes
+ setAddSwapStationPlan(false)} className="text-blue-600 hover:text-blue-800">
+
-
-
- ))}
-
- )}
-
- {(activeTab as string) === 'riderrequest' && (
-
-
-
Rider Request Plans
-
-
-
-
-
Rider Request Plans ({settings.plans.riderRequest.length})
-
Manage rider request plans for operators
-
-
{ setAddRiderPlan(true); setNewRiderName(''); }} className="px-4 py-2 bg-rose-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
- New Plan
-
-
-
- {addRiderPlan && (
-
-
-
-
New Rider Request Plan
-
Fill in the details below
+
+
+
+ Description
+
+
Create Plan
-
setAddRiderPlan(false)} className="text-rose-600 hover:text-rose-800">
-
-
-
-
+ )}
+
+
+ {settings.plans.swapStation.map((plan, idx) => (
+ setActiveSwapTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeSwapTab === idx ? 'border-blue-500 text-blue-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}> {plan.name}
+ ))}
+
+
+ {settings.plans.swapStation.length > 0 && settings.plans.swapStation.map((plan, idx) => idx === activeSwapTab && (
+
+
-
Plan Name
-
setNewRiderName(e.target.value)} placeholder="e.g., Premium Rider Plan" className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
{plan.name}
+
{plan.description}
-
- Tier
- setNewRiderTier(e.target.value)} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Premium
- Standard
- Economy
-
+ {plan.status}
+
+
+
+
+ Plan Name
+ { const updated = [...settings.plans.swapStation]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Status
+ { const updated = [...settings.plans.swapStation]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
+ Active
+ Paused
+ Closed
+
+
+
+ Battery Count
+ { const updated = [...settings.plans.swapStation]; updated[idx].batteryCount = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Swap Price (৳)
+ { const updated = [...settings.plans.swapStation]; updated[idx].swapPrice = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Subscription (৳)
+ { const updated = [...settings.plans.swapStation]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Daily Subscription (৳)
+ { const updated = [...settings.plans.swapStation]; updated[idx].dailySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Min Batteries
+ { const updated = [...settings.plans.swapStation]; updated[idx].minBatteries = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Max Batteries
+ { const updated = [...settings.plans.swapStation]; updated[idx].maxBatteries = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Profit Share (%)
+ { const updated = [...settings.plans.swapStation]; updated[idx].profitSharePercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, swapStation: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
-
-
Status
-
setNewRiderStatus(e.target.value)} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Active
- Paused
- Closed
-
+
+ Description
+
-
- Min Riders
- setNewRiderMin(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Max Riders
- setNewRiderMax(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription (৳)
- setNewRiderMonthly(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Subscription (৳)
- setNewRiderDaily(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Deposit (৳)
- setNewRiderDeposit(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Commission (%)
- setNewRiderCommission(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Ride Target
- setNewRiderTarget(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
-
Weekly Holiday
-
setNewRiderHoliday(parseInt(e.target.value))} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Save Changes
+
-
- Description
-
-
Create Plan
-
- )}
-
-
- {settings.plans.riderRequest.map((plan, idx) => (
- setActiveRiderTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeRiderTab === idx ? 'border-rose-500 text-rose-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>{idx + 1}. {plan.name}
))}
+ )
+ }
- {settings.plans.riderRequest.length > 0 && settings.plans.riderRequest.map((plan, idx) => idx === activeRiderTab && (
-
-
-
-
{plan.name} - {plan.tier}
-
{plan.description}
-
-
{plan.status}
+ {
+ (activeTab as string) === 'riderrequest' && (
+
+
+
Rider Request Plans
+
+
+
+
+
Rider Request Plans ({settings.plans.riderRequest.length})
+
Manage rider request plans for operators
-
-
+
{ setAddRiderPlan(true); setNewRiderName(''); }} className="px-4 py-2 bg-rose-600 text-white rounded-lg text-sm font-medium flex items-center gap-2">
+ New Plan
+
+
+
+ {addRiderPlan && (
+
+
-
Plan Name
-
{ const updated = [...settings.plans.riderRequest]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
New Rider Request Plan
+
Fill in the details below
-
- Tier
- { const updated = [...settings.plans.riderRequest]; updated[idx].tier = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Premium
- Standard
- Economy
-
-
-
- Status
- { const updated = [...settings.plans.riderRequest]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
- Active
- Paused
- Closed
-
-
-
- Min Riders
- { const updated = [...settings.plans.riderRequest]; updated[idx].minRiders = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Max Riders
- { const updated = [...settings.plans.riderRequest]; updated[idx].maxRiders = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Monthly Subscription (৳)
- { const updated = [...settings.plans.riderRequest]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Subscription (৳)
- { const updated = [...settings.plans.riderRequest]; updated[idx].dailySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Deposit (৳)
- { const updated = [...settings.plans.riderRequest]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Commission (%)
- { const updated = [...settings.plans.riderRequest]; updated[idx].commissionPercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Daily Ride Target
- { const updated = [...settings.plans.riderRequest]; updated[idx].dailyRideTarget = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
- Weekly Holiday
- { const updated = [...settings.plans.riderRequest]; updated[idx].weeklyHoliday = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
-
-
-
- Description
-
-
-
- Save Changes
+ setAddRiderPlan(false)} className="text-rose-600 hover:text-rose-800">
+
+
+
+
+ Description
+
+
Create Plan
+
+ )}
+
+
+ {settings.plans.riderRequest.map((plan, idx) => (
+ setActiveRiderTab(idx)} className={`px-4 py-2 text-sm font-medium border-b-2 -mb-px ${activeRiderTab === idx ? 'border-rose-500 text-rose-600' : 'border-transparent text-slate-500 hover:text-slate-700'}`}>{idx + 1}. {plan.name}
+ ))}
- ))}
-
- )}
-
-
+
+ {settings.plans.riderRequest.length > 0 && settings.plans.riderRequest.map((plan, idx) => idx === activeRiderTab && (
+
+
+
+
{plan.name} - {plan.tier}
+
{plan.description}
+
+
{plan.status}
+
+
+
+
+ Plan Name
+ { const updated = [...settings.plans.riderRequest]; updated[idx].name = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Tier
+ { const updated = [...settings.plans.riderRequest]; updated[idx].tier = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
+ Premium
+ Standard
+ Economy
+
+
+
+ Status
+ { const updated = [...settings.plans.riderRequest]; updated[idx].status = e.target.value; setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1">
+ Active
+ Paused
+ Closed
+
+
+
+ Min Riders
+ { const updated = [...settings.plans.riderRequest]; updated[idx].minRiders = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Max Riders
+ { const updated = [...settings.plans.riderRequest]; updated[idx].maxRiders = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Monthly Subscription (৳)
+ { const updated = [...settings.plans.riderRequest]; updated[idx].monthlySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Daily Subscription (৳)
+ { const updated = [...settings.plans.riderRequest]; updated[idx].dailySubscription = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Deposit (৳)
+ { const updated = [...settings.plans.riderRequest]; updated[idx].deposit = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Commission (%)
+ { const updated = [...settings.plans.riderRequest]; updated[idx].commissionPercent = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Daily Ride Target
+ { const updated = [...settings.plans.riderRequest]; updated[idx].dailyRideTarget = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+ Weekly Holiday
+ { const updated = [...settings.plans.riderRequest]; updated[idx].weeklyHoliday = parseInt(e.target.value); setSettings({ ...settings, plans: { ...settings.plans, riderRequest: updated } }); }} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
+
+
+
+ Description
+
+
+
+ Save Changes
+
+
+
+
+ ))}
+
+ )
+ }
+
+
-
+
);
}
\ No newline at end of file