chore: add Year Make Model subtitle to vehicle cards and hide empty VIN (refs #167)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ import DeleteIcon from '@mui/icons-material/Delete';
|
||||
import { Vehicle } from '../types/vehicles.types';
|
||||
import { useUnits } from '../../../core/units/UnitsContext';
|
||||
import { VehicleImage } from './VehicleImage';
|
||||
import { getVehicleLabel } from '@/core/utils/vehicleDisplay';
|
||||
import { getVehicleLabel, getVehicleSubtitle } from '@/core/utils/vehicleDisplay';
|
||||
|
||||
interface VehicleCardProps {
|
||||
vehicle: Vehicle;
|
||||
@@ -26,6 +26,7 @@ export const VehicleCard: React.FC<VehicleCardProps> = ({
|
||||
}) => {
|
||||
const { formatDistance } = useUnits();
|
||||
const displayName = getVehicleLabel(vehicle);
|
||||
const subtitle = getVehicleSubtitle(vehicle);
|
||||
|
||||
return (
|
||||
<Card
|
||||
@@ -46,13 +47,21 @@ export const VehicleCard: React.FC<VehicleCardProps> = ({
|
||||
<CardContent>
|
||||
<VehicleImage vehicle={vehicle} height={96} />
|
||||
|
||||
<Typography variant="h6" sx={{ fontWeight: 700, mb: 1 }}>
|
||||
<Typography variant="h6" sx={{ fontWeight: 700, mb: 0.5 }}>
|
||||
{displayName}
|
||||
</Typography>
|
||||
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 0.5 }}>
|
||||
VIN: {vehicle.vin}
|
||||
</Typography>
|
||||
|
||||
{subtitle && (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 0.5 }}>
|
||||
{subtitle}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
{vehicle.vin && (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 0.5 }}>
|
||||
VIN: {vehicle.vin}
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
{vehicle.licensePlate && (
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mb: 0.5 }}>
|
||||
|
||||
Reference in New Issue
Block a user