Photos for vehicles

This commit is contained in:
Eric Gullickson
2025-12-15 21:39:51 -06:00
parent e1c48b7a26
commit 263fc434b0
17 changed files with 745 additions and 58 deletions

View File

@@ -14,6 +14,7 @@ import { Vehicle } from '../types/vehicles.types';
import { vehiclesApi } from '../api/vehicles.api';
import { Card } from '../../../shared-minimal/components/Card';
import { VehicleForm } from '../components/VehicleForm';
import { VehicleImage } from '../components/VehicleImage';
import { useFuelLogs } from '../../fuel-logs/hooks/useFuelLogs';
import { FuelLogResponse, UpdateFuelLogRequest } from '../../fuel-logs/types/fuel-logs.types';
import { FuelLogEditDialog } from '../../fuel-logs/components/FuelLogEditDialog';
@@ -231,6 +232,7 @@ export const VehicleDetailPage: React.FC = () => {
initialData={vehicle}
onSubmit={handleUpdateVehicle}
onCancel={handleCancelEdit}
onImageUpdate={(updated) => setVehicle(updated)}
/>
</Card>
</Box>
@@ -287,10 +289,26 @@ export const VehicleDetailPage: React.FC = () => {
</Box>
<Card>
<Typography variant="h6" sx={{ fontWeight: 600, mb: 3 }}>
Vehicle Details
</Typography>
<Box sx={{ display: 'flex', gap: 3, mb: 3 }}>
<Box sx={{ width: 200, flexShrink: 0 }}>
<VehicleImage vehicle={vehicle} height={150} />
</Box>
<Box sx={{ flex: 1 }}>
<Typography variant="h6" sx={{ fontWeight: 600, mb: 2 }}>
Vehicle Details
</Typography>
<Typography variant="body2" color="text.secondary">
{vehicle.year} {vehicle.make} {vehicle.model}
{vehicle.trimLevel && ` ${vehicle.trimLevel}`}
</Typography>
{vehicle.vin && (
<Typography variant="body2" color="text.secondary" sx={{ mt: 0.5 }}>
VIN: {vehicle.vin}
</Typography>
)}
</Box>
</Box>
<form className="space-y-4">
<DetailField
label="VIN or License Plate"