'use client'; import { useState } from 'react'; import { Settings, Upload, Image, Globe, Mail, MessageSquare, Phone, MapPin, Link2, Clock, Save, FileText, Camera, Palette, Ruler, Sun, Moon, Monitor, Smartphone, Tablet, Package, Wrench, FileCheck, BadgeDollarSign, CreditCard } from 'lucide-react'; interface CompanySettings { name: string; shortName: string; tagLine: string; description: string; email: string; phone: string; website: string; address: string; city: string; country: string; tin: string; bin: string; tradeLicense: string; timezone: string; currency: string; language: string; logo: string; favicon: string; primaryColor: string; secondaryColor: string; borderRadius: number; socialLinks: { facebook: string; twitter: string; instagram: string; linkedin: string; youtube: string; }; smtp: { host: string; port: number; user: string; password: string; fromEmail: string; fromName: string; encryption: 'ssl' | 'tls' | 'none'; }; sms: { provider: string; apiKey: string; senderId: string; url: string; }; heroData: { title: string; subtitle: string; ctaText: string; ctaLink: string; videoUrl: string; backgroundImage: string; }; masterData: { kycDocuments: { name: string; required: boolean }[]; subscriptionPlans: { name: string; price: number; duration: number; features: string[] }[]; investorDocuments: { id: string; name: string; required: boolean; description: string }[]; merchantDocuments: { id: string; name: string; required: boolean; description: string }[]; swapStationDocuments: { id: string; name: string; required: boolean; description: string }[]; rentalDocuments: { type: 'single' | 'shared' | 'rent-to-own'; name: string; documents: { id: string; name: string; required: boolean; description: string }[]; }[]; }; parts: { id: string; name: string; price: number; inStock: number }[]; serviceCenters: { id: string; name: string; address: string; phone: string; rating: number }[]; rentalPolicy: { minAge: number; requireLicense: boolean; deposit: number; lateFeePerHour: number; cancellationFee: number; damagePenalty: { level: string; amount: number }[]; rules: string[]; }; } const initialSettings: CompanySettings = { name: 'JAIBEN Mobility Ltd', shortName: 'JAIBEN', tagLine: 'Your Trusted EV Mobility Partner', description: 'Leading electric vehicle rental and swap station network in Bangladesh', email: 'info@jaiben.com', phone: '+880 9611-222-333', website: 'https://jaiben.com', address: 'House 45, Road 13, Gulshan 1', city: 'Dhaka', country: 'Bangladesh', tin: '123456789012', bin: '987654321098', tradeLicense: 'TRAD/2023/001234', timezone: 'Asia/Dhaka', currency: 'BDT', language: 'en', logo: '/logo.png', favicon: '/favicon.ico', primaryColor: '#10B981', secondaryColor: '#3B82F6', borderRadius: 8, socialLinks: { facebook: 'https://facebook.com/jaiben', twitter: 'https://twitter.com/jaiben', instagram: 'https://instagram.com/jaiben', linkedin: 'https://linkedin.com/company/jaiben', youtube: 'https://youtube.com/@jaiben' }, smtp: { host: 'smtp.mailserver.com', port: 587, user: 'noreply@jaiben.com', password: '••••••••••••', fromEmail: 'noreply@jaiben.com', fromName: 'JAIBEN Mobility', encryption: 'tls' }, sms: { provider: 'BulkSMS', apiKey: '••••••••••••••••', senderId: 'JAIBEN', url: 'https://api.bulksmsbd.com' }, heroData: { title: 'Welcome to JAIBEN', subtitle: 'Your trusted partner for electric vehicle mobility solutions across Bangladesh', ctaText: 'Get Started', ctaLink: '/rent', videoUrl: '', backgroundImage: '/hero-bg.jpg' }, masterData: { kycDocuments: [ { name: 'NID Card', required: true }, { name: 'Driving License', required: true }, { name: 'Passport Photo', required: true }, { name: 'Address Proof', required: false }, { name: 'Business Trade License', required: false }, ], subscriptionPlans: [ { name: 'Daily', price: 500, duration: 1, features: ['24 hours access', 'Basic support'] }, { name: 'Weekly', price: 3000, duration: 7, features: ['7 days access', 'Priority support', 'Free swap'] }, { name: 'Monthly', price: 10000, duration: 30, features: ['30 days access', 'VIP support', 'Unlimited swap', 'Damage coverage'] }, { name: 'Yearly', price: 80000, duration: 365, features: ['1 year access', 'Dedicated manager', 'Unlimited swap', 'Full coverage', 'Discounted rates'] }, ], investorDocuments: [ { id: 'inv_nid', name: 'NID Card (Front & Back)', required: true, description: 'National ID card copy' }, { id: 'inv_photo', name: 'Passport Size Photo', required: true, description: 'Recent passport size photograph' }, { id: 'inv_bank', name: 'Bank Account Info', required: true, description: 'Bank account details for earnings' }, { id: 'inv_mobile', name: 'Mobile Banking', required: true, description: 'bKash/Rocket account details' }, { id: 'inv_tin', name: 'TIN Certificate', required: false, description: 'Tax Identification Number' }, { id: 'inv_tax', name: 'Tax Return', required: false, description: 'Recent tax return copy' }, { id: 'inv_ec', name: 'Emergency Contact ID', required: false, description: 'Emergency contact NID copy' }, ], merchantDocuments: [ { id: 'mer_trade', name: 'Trade License', required: true, description: 'Business trade license' }, { id: 'mer_nid', name: 'Owner NID Card', required: true, description: 'Owner/proprietor NID card' }, { id: 'mer_photo', name: 'Shop Photo', required: true, description: 'Photo of shop premises' }, { id: 'mer_tin', name: 'TIN Certificate', required: true, description: 'Tax Identification Number' }, { id: 'mer_bank', name: 'Bank Account Info', required: true, description: 'Business bank account' }, { id: 'mer_agreement', name: 'Shop Agreement', required: false, description: 'Rent agreement or ownership' }, { id: 'mer_fire', name: 'Fire License', required: false, description: 'Fire safety license' }, ], swapStationDocuments: [ { id: 'ss_trade', name: 'Trade License', required: true, description: 'Business trade license' }, { id: 'ss_owner_nid', name: 'Owner NID Card', required: true, description: 'Proprietor NID card' }, { id: 'ss_photo', name: 'Station Photo', required: true, description: 'Photo of swap station' }, { id: 'ss_tin', name: 'TIN Certificate', required: true, description: 'Tax Identification Number' }, { id: 'ss_electric', name: 'Electricity Bill', required: true, description: 'Recent electricity bill' }, { id: 'ss_agreement', name: 'Space Agreement', required: false, description: 'Rent/space agreement' }, { id: 'ss_safety', name: 'Safety Certificate', required: false, description: 'Electrical safety certificate' }, ], rentalDocuments: [ { type: 'single', name: 'Rental (Single)', documents: [ { id: 'rent_nid', name: 'NID Card', required: true, description: 'Valid National ID' }, { id: 'rent_license', name: 'Driving License', required: true, description: 'Valid driving license' }, { id: 'rent_photo', name: 'Passport Photo', required: true, description: 'Recent photo' }, { id: 'rent_deposit', name: 'Deposit Receipt', required: true, description: 'Security deposit proof' }, { id: 'rent_ec', name: 'Emergency Contact', required: true, description: 'Emergency contact info' }, ] }, { type: 'shared', name: 'Rental (2 Person Shared)', documents: [ { id: 'rent_nid_1', name: 'Rider 1 - NID Card', required: true, description: 'Primary rider NID' }, { id: 'rent_license_1', name: 'Rider 1 - Driving License', required: true, description: 'Primary rider license' }, { id: 'rent_nid_2', name: 'Rider 2 - NID Card', required: true, description: 'Secondary rider NID' }, { id: 'rent_license_2', name: 'Rider 2 - Driving License', required: true, description: 'Secondary rider license' }, { id: 'rent_photo', name: 'Passport Photos (Both)', required: true, description: 'Photos of both riders' }, { id: 'rent_deposit', name: 'Deposit Receipt', required: true, description: 'Security deposit proof' }, { id: 'rent_agreement', name: 'Shared Agreement', required: true, description: 'Agreement between riders' }, { id: 'rent_ec', name: 'Emergency Contacts', required: true, description: 'Emergency contacts for both' }, ] }, { type: 'rent-to-own', name: 'Rent-to-Own', documents: [ { id: 'rto_nid', name: 'NID Card', required: true, description: 'Valid National ID' }, { id: 'rto_license', name: 'Driving License', required: true, description: 'Valid driving license' }, { id: 'rto_photo', name: 'Passport Photo', required: true, description: 'Recent photo' }, { id: 'rto_income', name: 'Income Proof', required: true, description: 'Salary/income certificate' }, { id: 'rto_bank', name: 'Bank Statement', required: true, description: '6 months bank statement' }, { id: 'rto_tin', name: 'TIN Certificate', required: false, description: 'Tax Identification Number' }, { id: 'rto_guarantor', name: 'Guarantor Info', required: true, description: 'Guarantor details' }, { id: 'rto_guarantor_nid', name: 'Guarantor NID', required: true, description: 'Guarantor NID copy' }, { id: 'rto_agreement', name: 'RTO Agreement', required: true, description: 'Rent-to-own contract' }, { id: 'rto_insurance', name: 'Insurance', required: false, description: 'Vehicle insurance' }, ] }, ] }, parts: [ { id: 'PRT-001', name: 'Battery 60V', price: 15000, inStock: 25 }, { id: 'PRT-002', name: 'Front Tire', price: 2500, inStock: 50 }, { id: 'PRT-003', name: 'Rear Tire', price: 2500, inStock: 50 }, { id: 'PRT-004', name: 'Brake Pad', price: 800, inStock: 100 }, { id: 'PRT-005', name: 'Mirror', price: 350, inStock: 80 }, ], serviceCenters: [ { id: 'SC-001', name: 'JAIBEN Service Center - Gulshan', address: 'House 45, Road 13, Gulshan 1, Dhaka', phone: '+8801712345670', rating: 4.8 }, { id: 'SC-002', name: 'JAIBEN Service Center - Banani', address: 'Road 11, Banani, Dhaka', phone: '+8801712345671', rating: 4.5 }, ], rentalPolicy: { minAge: 18, requireLicense: true, deposit: 5000, lateFeePerHour: 200, cancellationFee: 1000, damagePenalty: [ { level: 'Minor Scratch', amount: 500 }, { level: 'Major Damage', amount: 5000 }, { level: 'Total Loss', amount: 25000 }, ], rules: [ 'No smoking in vehicles', 'Return with same fuel/charge level', 'No unauthorized drivers', 'Follow traffic rules', 'Report accidents within 24 hours', ] } }; export default function CompanySettingsPage() { const [settings, setSettings] = useState(initialSettings); const [activeTab, setActiveTab] = useState<'general' | 'branding' | 'social' | 'integration' | 'landing' | 'master' | 'rental'>('general'); const [activeMasterTab, setActiveMasterTab] = useState<'kyc' | 'investor' | 'merchant' | 'swapstation' | 'rental' | 'plans' | 'parts' | 'service'>('kyc'); const [saved, setSaved] = useState(false); const handleSave = () => { setSaved(true); setTimeout(() => setSaved(false), 2000); }; const tabs = [ { id: 'general', label: 'General', icon: Settings }, { id: 'branding', label: 'Branding', icon: Palette }, { id: 'social', label: 'Social Media', icon: Link2 }, { id: 'integration', label: 'Integrations', icon: Mail }, { id: 'landing', label: 'Landing Page', icon: Monitor }, { id: 'master', label: 'Master Data', icon: Package }, { id: 'rental', label: 'Rental Policy', icon: FileCheck }, ]; return (

Company Settings

Manage your company information and configurations

{saved && (
Settings saved successfully!
)}
{activeTab === 'general' && (

General Information

setSettings({ ...settings, name: e.target.value })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
setSettings({ ...settings, shortName: e.target.value })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
setSettings({ ...settings, tagLine: e.target.value })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />
setSettings({ ...settings, website: e.target.value })} className="w-full px-3 py-2 border border-slate-200 rounded-lg text-sm mt-1" />