feat: update rider plan to single_rent and integrate SMS history display in KYC admin pages

This commit is contained in:
sazzadulalambd
2026-05-05 02:48:57 +06:00
parent 111b242bf8
commit 291d9ca68b
2 changed files with 27 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ const mockRequests: Request[] = [
{ id: 'd3', name: 'Driving License', status: 'pending' }, { id: 'd3', name: 'Driving License', status: 'pending' },
{ id: 'd4', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-20' }, { id: 'd4', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-20' },
], ],
riderPlan: 'daily_rent', riderPlan: 'single_rent',
employmentInfo: { company: 'Foodpanda', dailyEarning: 2500, whyEV: 'Low maintenance, good for delivery', experience: '3 years bike riding' }, employmentInfo: { company: 'Foodpanda', dailyEarning: 2500, whyEV: 'Low maintenance, good for delivery', experience: '3 years bike riding' },
nomineeDetails: { name: 'Fatema', phone: '01712345699', relationship: 'Wife', nid: '1234567890123' }, nomineeDetails: { name: 'Fatema', phone: '01712345699', relationship: 'Wife', nid: '1234567890123' },
securityDeposit: 5000, securityDeposit: 5000,
@@ -306,8 +306,7 @@ export default function KYCDetailPage() {
smsHistory: [ smsHistory: [
...(prev.smsHistory || []), ...(prev.smsHistory || []),
{ id: `sms-${Date.now()}`, message: newMessageText, sentAt: new Date().toISOString(), sentBy: 'admin' } { id: `sms-${Date.now()}`, message: newMessageText, sentAt: new Date().toISOString(), sentBy: 'admin' }
], ]
notes: [...prev.notes, newMessageText]
} : null); } : null);
setNewMessageText(''); setNewMessageText('');
setShowMessageModal(false); setShowMessageModal(false);
@@ -694,6 +693,29 @@ export default function KYCDetailPage() {
<p className="text-sm text-slate-400">No notes yet</p> <p className="text-sm text-slate-400">No notes yet</p>
)} )}
</div> </div>
<div className="bg-slate-50 p-4 rounded-xl border border-slate-100">
<h3 className="font-semibold text-slate-800 mb-3 flex items-center gap-2">
<MessageSquare className="w-5 h-5" /> SMS History ({(request.smsHistory || []).length})
</h3>
{(request.smsHistory || []).length > 0 ? (
<div className="space-y-2">
{(request.smsHistory || []).slice().reverse().map((sms) => (
<div key={sms.id} className={`p-2 rounded-lg ${sms.sentBy === 'admin' ? 'bg-blue-50' : 'bg-green-50'}`}>
<div className="flex items-center justify-between mb-1">
<span className={`text-xs font-medium ${sms.sentBy === 'admin' ? 'text-blue-600' : 'text-green-600'}`}>
{sms.sentBy === 'admin' ? 'Admin' : 'User'}
</span>
<span className="text-xs text-slate-400">{sms.sentAt}</span>
</div>
<p className="text-sm text-slate-700">{sms.message}</p>
</div>
))}
</div>
) : (
<p className="text-sm text-slate-400">No SMS history yet</p>
)}
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -121,7 +121,7 @@ const mockRequests: Request[] = [
{ id: 'd3', name: 'Driving License', status: 'pending' }, { id: 'd3', name: 'Driving License', status: 'pending' },
{ id: 'd4', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-20' }, { id: 'd4', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-20' },
], ],
riderPlan: 'daily_rent', riderPlan: 'single_rent',
employmentInfo: { company: 'Foodpanda', monthlyEarning: 2500, whyEV: 'Low maintenance, good for delivery', experience: '3 years bike riding' }, employmentInfo: { company: 'Foodpanda', monthlyEarning: 2500, whyEV: 'Low maintenance, good for delivery', experience: '3 years bike riding' },
notes: ['Downloaded app and applied through mobile'], notes: ['Downloaded app and applied through mobile'],
smsHistory: [], smsHistory: [],
@@ -242,7 +242,7 @@ const mockRequests: Request[] = [
{ id: 'd18', name: 'Driving License', status: 'uploaded', uploadedAt: '2024-03-21' }, { id: 'd18', name: 'Driving License', status: 'uploaded', uploadedAt: '2024-03-21' },
{ id: 'd19', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-21' }, { id: 'd19', name: 'Profile Photo', status: 'uploaded', uploadedAt: '2024-03-21' },
], ],
riderPlan: 'monthly_rent', riderPlan: 'single_rent',
nomineeDetails: { name: 'Rashid', phone: '01798765432', relationship: 'Brother', nid: '9876543210987' }, nomineeDetails: { name: 'Rashid', phone: '01798765432', relationship: 'Brother', nid: '9876543210987' },
employmentInfo: { company: ' ssl', monthlyEarning: 2000, whyEV: 'Better income than fuel bike', experience: '2 years' }, employmentInfo: { company: ' ssl', monthlyEarning: 2000, whyEV: 'Better income than fuel bike', experience: '2 years' },
notes: [], notes: [],