fix: promote vehicle display utils to core with null safety (refs #165)
Create shared getVehicleLabel/getVehicleSubtitle in core/utils with VehicleLike interface. Replace all direct year/make/model concatenation across 17 consumer files to prevent null values in vehicle names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import ErrorRoundedIcon from '@mui/icons-material/ErrorRounded';
|
||||
import WarningAmberRoundedIcon from '@mui/icons-material/WarningAmberRounded';
|
||||
import ScheduleRoundedIcon from '@mui/icons-material/ScheduleRounded';
|
||||
import { GlassCard } from '../../../shared-minimal/components/mobile/GlassCard';
|
||||
import { getVehicleLabel } from '@/core/utils/vehicleDisplay';
|
||||
import { VehicleNeedingAttention } from '../types';
|
||||
|
||||
interface VehicleAttentionProps {
|
||||
@@ -104,7 +105,7 @@ export const VehicleAttention: React.FC<VehicleAttentionProps> = ({ vehicles, on
|
||||
mb: 0.5,
|
||||
}}
|
||||
>
|
||||
{vehicle.nickname || `${vehicle.year} ${vehicle.make} ${vehicle.model}`}
|
||||
{getVehicleLabel(vehicle)}
|
||||
</Box>
|
||||
<p className="text-sm text-slate-600 dark:text-titanio">
|
||||
{vehicle.reason}
|
||||
|
||||
Reference in New Issue
Block a user