Skip to content
This repository was archived by the owner on Nov 23, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/components/VehicleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function VehicleCard({ vehicle, onDelete, onEdit }: VehicleCardPr
<div className="space-y-2 mb-4 py-3 automotive-border-t">
<div className="flex justify-between text-sm">
<span className="theme-text-muted">Mileage:</span>
<span className="font-semibold theme-text-primary">{vehicle.mileage.toLocaleString()} miles</span>
<span className="font-semibold theme-text-primary">{(vehicle.mileage ?? 0).toLocaleString()} miles</span>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/dashboards/CustomerDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const CustomerDashboard: React.FC<CustomerDashboardProps> = ({ profile }) => {
overdueInvoices.slice(0, 3).map((invoice) => (
<div key={invoice.invoiceId} className="border border-gray-200 dark:border-gray-700 rounded-lg p-3">
<p className="theme-text-primary font-medium text-sm">Invoice {invoice.invoiceNumber}</p>
<p className="theme-text-muted text-xs mb-1">Amount due: LKR {invoice.totalAmount.toLocaleString()}</p>
<p className="theme-text-muted text-xs mb-1">Amount due: LKR {(invoice.totalAmount ?? 0).toLocaleString()}</p>
<Link
href={`/dashboard/invoices/${invoice.invoiceId}`}
className="text-xs text-blue-600 dark:text-blue-400 hover:underline"
Expand Down
8 changes: 4 additions & 4 deletions src/app/dashboard/payments/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ export default function PaymentHistoryPage() {
</div>
</td>
<td className="py-3 pr-4 text-right font-semibold">{formatCurrency(payment.amount)}</td>
<td className="py-3 pr-4 uppercase">{payment.paymentMethod.replace('_', ' ')}</td>
<td className="py-3 pr-4 uppercase">{payment.paymentMethod?.replace('_', ' ') ?? '—'}</td>
<td className="py-3 pr-4">
<span className={`inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold ${statusBadge[payment.paymentStatus] ?? 'bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-300'}`}>
{payment.paymentStatus}
<span className={`inline-flex items-center px-3 py-1 rounded-full text-xs font-semibold ${statusBadge[payment.paymentStatus ?? ''] ?? 'bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-300'}`}>
{payment.paymentStatus ?? 'UNKNOWN'}
</span>
</td>
<td className="py-3 pr-4">{formatDate(payment.processedAt ?? payment.createdAt)}</td>
<td className="py-3 pr-4">{payment.processedAt ? formatDate(payment.processedAt) : (payment.createdAt ? formatDate(payment.createdAt) : '—')}</td>
<td className="py-3 pr-4 text-xs theme-text-secondary max-w-xs">{payment.notes ?? '—'}</td>
</tr>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/vehicles/[vehicleId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default function VehicleDetailsPage() {
</div>
<div>
<h4 className="text-xs theme-text-muted">Mileage</h4>
<div className="font-semibold theme-text-primary">{vehicle.mileage.toLocaleString()} mi</div>
<div className="font-semibold theme-text-primary">{(vehicle.mileage ?? 0).toLocaleString()} mi</div>
</div>
<div>
<h4 className="text-xs theme-text-muted">Color</h4>
Expand Down