@bytebrand/fe-ui-core 4.8.37 → 4.8.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,1717 +1,1717 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
|
|
4
|
-
import Icon from '../../components/_common/IconContainer/IconContainer';
|
|
5
|
-
import CO2Efficiency from '../../components/_common/Co2Widget/CO2Efficiency';
|
|
6
|
-
import { formatTimestamp } from '../utils/DateUtils';
|
|
7
|
-
import { formatMileage } from '../utils/CommonUtils';
|
|
8
|
-
import { EMISSION_STICKERS_ICONS, WP_EMISSION_STICKERS_ICONS } from '../constants/Search';
|
|
9
|
-
import { DELIVERY_PERIODS_EXTRA } from '../constants';
|
|
10
|
-
import { IDecoratedProp, ICar, IFinancingUtils } from '../types/types';
|
|
11
|
-
import { getFormattedPrice } from '../utils/CommonUtils';
|
|
12
|
-
|
|
13
|
-
const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
|
|
14
|
-
const count: number = +DELIVERY_PERIODS_EXTRA.find((period: any) => period.value === deliveryPeriod).label;
|
|
15
|
-
// months until delivery date unrounded (float)
|
|
16
|
-
const monthsTo: number = moment.utc().diff(moment.utc().subtract(count, 'd'), 'M', true);
|
|
17
|
-
return Math.round(monthsTo) > 1
|
|
18
|
-
? t('vehicleProps:value.deliveryPeriodMonths', { count: Math.round(monthsTo) })
|
|
19
|
-
: t('vehicleProps:value.deliveryPeriodDays', { count });
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const isPropDefined = (prop: any) => {
|
|
23
|
-
const type = typeof prop;
|
|
24
|
-
if (type === 'string') {
|
|
25
|
-
return prop.indexOf('other') === -1
|
|
26
|
-
&& prop.indexOf('unknown') === -1;
|
|
27
|
-
}
|
|
28
|
-
return !(prop === undefined || prop === null) && type !== 'undefined';
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const isCheckedBatteryTime = (prop: any, t: (key: string, options?: object) => string) => {
|
|
32
|
-
switch (prop) {
|
|
33
|
-
case 'selector_batteryCharchingDurationMinutes':
|
|
34
|
-
return 'min';
|
|
35
|
-
break;
|
|
36
|
-
case 'selector_batteryCharchingDurationHours':
|
|
37
|
-
return 'h';
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
return t('vehicleProps:value.na');
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const getPowerLabel = (powerKW: number, powerPS: number): string => {
|
|
45
|
-
const powerKWlabel = !!powerKW ? `${powerKW} kW ` : '';
|
|
46
|
-
const powerPSlabel = !!powerPS ? `${!!powerKW ? '(' : ''}${powerPS} PS${!!powerKW ? ')' : ''}` : '';
|
|
47
|
-
const powerKWpowerPS = `${powerKWlabel}${powerPSlabel}`;
|
|
48
|
-
|
|
49
|
-
return powerKWpowerPS;
|
|
50
|
-
};
|
|
51
|
-
const wrapValue = (value:string): React.ReactNode => {
|
|
52
|
-
const regex = /-?\d+(\,\d+)?/; // match any digit
|
|
53
|
-
const matches = value.match(regex); // get an array of all digits found
|
|
54
|
-
|
|
55
|
-
if (matches && matches.length > 0) { // If at least one number is found in the input string
|
|
56
|
-
const index = value.indexOf(matches[0]) + matches[0].length;
|
|
57
|
-
const beforeText = value.slice(0, index);
|
|
58
|
-
const afterText = value.slice(index);
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<>
|
|
62
|
-
{beforeText}
|
|
63
|
-
<span className='smallText'>{afterText}</span>
|
|
64
|
-
</>
|
|
65
|
-
); // Return a JSX element with a span wrapper around the text after the number
|
|
66
|
-
}
|
|
67
|
-
return <>{value}</>; // If no numbers are found in the input string, return the original string without any modification
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const getDecoratedProps = (
|
|
71
|
-
car: ICar, // @TODO should have a proper interface
|
|
72
|
-
t: (key: string, options?: object) => string,
|
|
73
|
-
language: string = 'en',
|
|
74
|
-
simplifiedLabels: boolean = false, // shortened labels for repsonsive layout (see 'power'),
|
|
75
|
-
financingUtils?: IFinancingUtils
|
|
76
|
-
): IDecoratedProp => {
|
|
77
|
-
const {
|
|
78
|
-
offer = {},
|
|
79
|
-
// countryName,
|
|
80
|
-
mainData: {
|
|
81
|
-
firstRegistration = '',
|
|
82
|
-
mileage = '',
|
|
83
|
-
numberOfPreviousOwners = '',
|
|
84
|
-
doors = '',
|
|
85
|
-
usageType = '',
|
|
86
|
-
countryVersion = '',
|
|
87
|
-
condition = '',
|
|
88
|
-
damaged = '',
|
|
89
|
-
category = '',
|
|
90
|
-
seats = '',
|
|
91
|
-
nonSmokerVehicle = '',
|
|
92
|
-
make = '',
|
|
93
|
-
model = ''
|
|
94
|
-
} = {}
|
|
95
|
-
} = car;
|
|
96
|
-
const props: any = {
|
|
97
|
-
makeModel: {
|
|
98
|
-
title: t('vehicleProps:title.makeModel'),
|
|
99
|
-
get value() { return `${make} ${model}`; }
|
|
100
|
-
},
|
|
101
|
-
mileage: {
|
|
102
|
-
title: t('vehicleProps:title.mileage'),
|
|
103
|
-
icon: 'speed',
|
|
104
|
-
get value() {
|
|
105
|
-
return Number.isFinite(parseInt(mileage, 10))
|
|
106
|
-
? t('vehicleProps:value.mileage', { mileage: formatMileage(mileage) })
|
|
107
|
-
: t('vehicleProps:value.na');
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
firstRegistration: {
|
|
112
|
-
title: t('vehicleProps:title.firstRegistration'),
|
|
113
|
-
icon: 'date',
|
|
114
|
-
get value() {
|
|
115
|
-
return Number.isFinite(firstRegistration)
|
|
116
|
-
? formatTimestamp({ timestamp: firstRegistration, format: 'MM/YYYY' })
|
|
117
|
-
: t('vehicleProps:value.na');
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
numberOfPreviousOwners: {
|
|
122
|
-
title: t('vehicleProps:title.numberOfPreviousOwners'),
|
|
123
|
-
icon: 'owner',
|
|
124
|
-
get value() {
|
|
125
|
-
return Number.isFinite(numberOfPreviousOwners)
|
|
126
|
-
? t('vehicleProps:value.vehicleOwners', { count: numberOfPreviousOwners })
|
|
127
|
-
: t('vehicleProps:value.na');
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
doorsOnly: {
|
|
132
|
-
icon: 'door',
|
|
133
|
-
get value() {
|
|
134
|
-
if (doors > 0) {
|
|
135
|
-
return t('vehicleProps:value.doorsOnly', { doors });
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return t('vehicleProps:value.na');
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
usageType: {
|
|
143
|
-
icon: 'new',
|
|
144
|
-
get value() {
|
|
145
|
-
if (condition === 'selector_condition_new') return t('vehicleProps:value.newCar');
|
|
146
|
-
return isPropDefined(usageType) ? t(`cbd:${usageType}`) : t('cbd:selector_condition_used');
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
gearbox: {
|
|
151
|
-
get icon() {
|
|
152
|
-
const gearbox = car.driveSuspension.gearbox;
|
|
153
|
-
return isPropDefined(gearbox) ? car.driveSuspension.gearbox : 'selector_gearbox_manualShift';
|
|
154
|
-
},
|
|
155
|
-
get value() {
|
|
156
|
-
const gearbox = car.driveSuspension.gearbox;
|
|
157
|
-
return isPropDefined(gearbox) ? t(`cbd:${gearbox}`) : t('vehicleProps:value.na');
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
power: {
|
|
162
|
-
title: t('vehicleProps:title.power'),
|
|
163
|
-
icon: 'ps',
|
|
164
|
-
get value() {
|
|
165
|
-
const { powerKW, powerPS } = car.engineData;
|
|
166
|
-
|
|
167
|
-
if (Number.isFinite(powerKW) && Number.isFinite(powerPS)) {
|
|
168
|
-
return simplifiedLabels
|
|
169
|
-
? t('vehicleProps:value.powerPS', { powerPS })
|
|
170
|
-
: t('vehicleProps:value.power', { powerKW, powerPS });
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
return t('vehicleProps:value.na');
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
powerAlternateView: {
|
|
178
|
-
title: t('vehicleProps:title.power'),
|
|
179
|
-
icon: 'kw',
|
|
180
|
-
get value() {
|
|
181
|
-
const { powerKW, powerPS } = car.engineData;
|
|
182
|
-
return Number.isFinite(powerKW) && Number.isFinite(powerPS)
|
|
183
|
-
? t('vehicleProps:value.powerAlternateView', { powerKW, powerPS })
|
|
184
|
-
: t('vehicleProps:value.na');
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
fuel: {
|
|
189
|
-
title: t('vehicleProps:title.fuel'),
|
|
190
|
-
get icon() { return car.consumption.fuel; },
|
|
191
|
-
get value() {
|
|
192
|
-
const fuel = car.consumption.fuel;
|
|
193
|
-
return isPropDefined(fuel) ? t(`cbd:${fuel}`) : t('vehicleProps:value.na');
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
|
|
197
|
-
accidentDamaged: {
|
|
198
|
-
title: t('cbd:mainData_accidentDamaged'),
|
|
199
|
-
icon: 'wrench',
|
|
200
|
-
get value() {
|
|
201
|
-
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
co2: {
|
|
206
|
-
icon: 'co2',
|
|
207
|
-
get value() {
|
|
208
|
-
const co2 = car.environmentEmissions.co2;
|
|
209
|
-
return Number.isFinite(co2)
|
|
210
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
211
|
-
: t('vehicleProps:value.na');
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
cylinders: {
|
|
216
|
-
title: t('vehicleProps:title.cylinders'),
|
|
217
|
-
get value() {
|
|
218
|
-
const { engineLocation } = car.engineData;
|
|
219
|
-
const cylinders = parseInt(car.engineData.cylinders, 10);
|
|
220
|
-
return Number.isFinite(cylinders)
|
|
221
|
-
? (engineLocation ? `${cylinders} / ${t(`cbd:${engineLocation}`)}` : cylinders)
|
|
222
|
-
: t('vehicleProps:value.na');
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
|
|
226
|
-
plugIn: {
|
|
227
|
-
title: 'Plug-In',
|
|
228
|
-
get value() {
|
|
229
|
-
const { hybridPlugin } = car.engineData;
|
|
230
|
-
return hybridPlugin ? t(`cbd:selector_hybridPlugin_yes`) : t('cbd:selector_hybridPlugin_no');
|
|
231
|
-
}
|
|
232
|
-
},
|
|
233
|
-
|
|
234
|
-
cubicCapacity: {
|
|
235
|
-
title: t('vehicleProps:title.cubicCapacity'),
|
|
236
|
-
get value() {
|
|
237
|
-
const cubicCapacity = car.engineData.cubicCapacity;
|
|
238
|
-
return Number.isFinite(cubicCapacity)
|
|
239
|
-
? t('vehicleProps:value.cubicCapacity', { cubicCapacity: cubicCapacity.toLocaleString(language) })
|
|
240
|
-
: t('vehicleProps:value.na');
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
torque: {
|
|
245
|
-
title: t('vehicleProps:title.torque'),
|
|
246
|
-
get value() {
|
|
247
|
-
const torque = car.engineData.torque;
|
|
248
|
-
return torque
|
|
249
|
-
? t('vehicleProps:value.torque', { torque })
|
|
250
|
-
: t('vehicleProps:value.na');
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
acceleration: {
|
|
255
|
-
title: t('vehicleProps:title.acceleration'),
|
|
256
|
-
get value() {
|
|
257
|
-
const acceleration = car.engineData.acceleration100;
|
|
258
|
-
return isPropDefined(acceleration)
|
|
259
|
-
? (t('vehicleProps:value.acceleration', { seconds: acceleration }))
|
|
260
|
-
: t('vehicleProps:value.na');
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
topSpeed: {
|
|
265
|
-
title: t('vehicleProps:title.topSpeed'),
|
|
266
|
-
get value() {
|
|
267
|
-
const topSpeed = car.engineData.highSpeed;
|
|
268
|
-
return isPropDefined(topSpeed)
|
|
269
|
-
? (t('vehicleProps:value.topSpeed', { mileage: topSpeed }))
|
|
270
|
-
: t('vehicleProps:value.na');
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
transmission: {
|
|
275
|
-
title: t('vehicleProps:title.transmission'),
|
|
276
|
-
get value() {
|
|
277
|
-
const gearbox = car.driveSuspension.gearbox;
|
|
278
|
-
return isPropDefined(gearbox) ? t(`cbd:${gearbox}`) : t('vehicleProps:value.na');
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
driveType: {
|
|
283
|
-
title: t('vehicleProps:title.driveType'),
|
|
284
|
-
get icon() {
|
|
285
|
-
const driveType = car.driveSuspension.driveType;
|
|
286
|
-
return isPropDefined(driveType) ? car.driveSuspension.driveType : 'selector_driveType_frontWheelDrive';
|
|
287
|
-
},
|
|
288
|
-
get value() {
|
|
289
|
-
const driveType = car.driveSuspension.driveType;
|
|
290
|
-
return isPropDefined(driveType) ? t(`cbd:${driveType}`) : t('vehicleProps:value.na');
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
fuelCapacity: {
|
|
295
|
-
title: t('vehicleProps:title.fuelCapacity'),
|
|
296
|
-
get value() {
|
|
297
|
-
const fuelCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.fuelCapacity;
|
|
298
|
-
return Number.isFinite(fuelCapacity)
|
|
299
|
-
? t('vehicleProps:value.fuelCapacity', { capacity: fuelCapacity.toLocaleString(language) })
|
|
300
|
-
: t('vehicleProps:value.na');
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
batteryCapacity: {
|
|
305
|
-
title: t('vehicleProps:title.batteryCapacityTitle'),
|
|
306
|
-
get value() {
|
|
307
|
-
const batteryCapacity = car.battery && car.battery.batteryCapacity;
|
|
308
|
-
return batteryCapacity && Number.isFinite(batteryCapacity)
|
|
309
|
-
? t('vehicleProps:value.batteryCapacity', { batteryCapacity: batteryCapacity.toLocaleString(language) })
|
|
310
|
-
: t('vehicleProps:value.na');
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
chargingDuration230V: {
|
|
315
|
-
title: t('vehicleProps:title.chargingDuration230V'),
|
|
316
|
-
get value() {
|
|
317
|
-
const batteryChargingDuration230VSelect = car.battery && car.battery.batteryChargingDuration230VSelect;
|
|
318
|
-
const batteryChargingDuration230VHour = car.battery && car.battery.batteryChargingDuration230VHour;
|
|
319
|
-
const batteryCharchingDuration230VMinutesHours = car.battery && car.battery.batteryCharchingDuration230VMinutesHours;
|
|
320
|
-
|
|
321
|
-
return batteryChargingDuration230VSelect
|
|
322
|
-
? `${batteryChargingDuration230VHour ? `${batteryChargingDuration230VHour} ${isCheckedBatteryTime(batteryCharchingDuration230VMinutesHours, t)}` : ''} ${batteryChargingDuration230VSelect}`
|
|
323
|
-
: t('vehicleProps:value.na');
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
chargingDurationMaxSpeed: {
|
|
327
|
-
title: t('vehicleProps:title.chargingDurationMaxSpeed'),
|
|
328
|
-
get value() {
|
|
329
|
-
const batteryChargingDurationMaxSelect = car.battery && car.battery.batteryChargingDurationMaxSelect;
|
|
330
|
-
const batteryChargingDurationMaxHour = car.battery && car.battery.batteryChargingDurationMaxHour;
|
|
331
|
-
const batteryCharchingDurationMaxSelectMinutesHours = car.battery && car.battery.batteryCharchingDurationMaxSelectMinutesHours;
|
|
332
|
-
|
|
333
|
-
return batteryChargingDurationMaxSelect
|
|
334
|
-
? `${batteryChargingDurationMaxHour ? `${batteryChargingDurationMaxHour} ${isCheckedBatteryTime(batteryCharchingDurationMaxSelectMinutesHours, t)}` : ''} ${batteryChargingDurationMaxSelect}`
|
|
335
|
-
: t('vehicleProps:value.na');
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
batteryChargerType: {
|
|
339
|
-
title: t('vehicleProps:title.batteryChargerType'),
|
|
340
|
-
get value() {
|
|
341
|
-
const batteryChargerType = car.battery && car.battery.batteryChargerType;
|
|
342
|
-
|
|
343
|
-
return isPropDefined(batteryChargerType)
|
|
344
|
-
? batteryChargerType.map((item: any) => t(`cbd:${item}`)).join('\n')
|
|
345
|
-
: t('vehicleProps:value.na');
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
hsn: {
|
|
349
|
-
title: 'HSN',
|
|
350
|
-
get value() {
|
|
351
|
-
const hsn = car.metaData.hsn;
|
|
352
|
-
return isPropDefined(hsn) ? hsn : t('vehicleProps:value.na');
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
tsn: {
|
|
357
|
-
title: 'TSN',
|
|
358
|
-
get value() {
|
|
359
|
-
const tsn = car.metaData.tsn;
|
|
360
|
-
return isPropDefined(tsn) ? tsn : t('vehicleProps:value.na');
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
category: {
|
|
365
|
-
title: t('vehicleProps:title.category'),
|
|
366
|
-
get value() {
|
|
367
|
-
return isPropDefined(category) ? t(`cbd:${category}`) : t('vehicleProps:value.na');
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
|
|
371
|
-
length: {
|
|
372
|
-
title: t('vehicleProps:title.length'),
|
|
373
|
-
get value() {
|
|
374
|
-
const length = car.sizeVolumeWeight && car.sizeVolumeWeight.length;
|
|
375
|
-
return Number.isFinite(length)
|
|
376
|
-
? t('vehicleProps:value.length', { size: length.toLocaleString(language) })
|
|
377
|
-
: t('vehicleProps:value.na');
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
|
|
381
|
-
width: {
|
|
382
|
-
title: t('vehicleProps:title.width'),
|
|
383
|
-
get value() {
|
|
384
|
-
const width = car.sizeVolumeWeight && car.sizeVolumeWeight.width;
|
|
385
|
-
return Number.isFinite(width)
|
|
386
|
-
? t('vehicleProps:value.width', { size: width.toLocaleString(language) })
|
|
387
|
-
: t('vehicleProps:value.na');
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
height: {
|
|
392
|
-
title: t('vehicleProps:title.height'),
|
|
393
|
-
get value() {
|
|
394
|
-
const height = car.sizeVolumeWeight && car.sizeVolumeWeight.height;
|
|
395
|
-
return Number.isFinite(height)
|
|
396
|
-
? t('vehicleProps:value.height', { size: height.toLocaleString(language) })
|
|
397
|
-
: t('vehicleProps:value.na');
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
|
|
401
|
-
base: {
|
|
402
|
-
title: t('vehicleProps:title.base'),
|
|
403
|
-
get value() {
|
|
404
|
-
const wheelBase = car.driveSuspension.wheelBase;
|
|
405
|
-
return Number.isFinite(wheelBase)
|
|
406
|
-
? t('vehicleProps:value.base', { size: wheelBase.toLocaleString(language) })
|
|
407
|
-
: t('vehicleProps:value.na');
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
capacityLoad: {
|
|
412
|
-
title: t('vehicleProps:title.loadingVolume'),
|
|
413
|
-
get value() {
|
|
414
|
-
const completeCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.completeCapacity;
|
|
415
|
-
return Number.isFinite(completeCapacity)
|
|
416
|
-
? t('vehicleProps:value.capacityLoad', { capacity: completeCapacity.toLocaleString(language) })
|
|
417
|
-
: t('vehicleProps:value.na');
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
bootCapacity: {
|
|
422
|
-
title: t('vehicleProps:title.bootCapacity'),
|
|
423
|
-
get value() {
|
|
424
|
-
const cargoCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.cargoCapacity;
|
|
425
|
-
return Number.isFinite(cargoCapacity)
|
|
426
|
-
? t('vehicleProps:value.bootCapacity', { capacity: cargoCapacity.toLocaleString(language) })
|
|
427
|
-
: t('vehicleProps:value.na');
|
|
428
|
-
}
|
|
429
|
-
},
|
|
430
|
-
|
|
431
|
-
doors: {
|
|
432
|
-
title: t('vehicleProps:title.doors'),
|
|
433
|
-
get value() { return doors > 0 ? doors : t('vehicleProps:value.na'); }
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
seats: {
|
|
437
|
-
title: t('vehicleProps:title.seats'),
|
|
438
|
-
get value() { return seats > 0 ? seats : t('vehicleProps:value.na'); }
|
|
439
|
-
},
|
|
440
|
-
|
|
441
|
-
tare: {
|
|
442
|
-
title: t('vehicleProps:title.tare'),
|
|
443
|
-
get value() {
|
|
444
|
-
const emptyWeight = car.sizeVolumeWeight && car.sizeVolumeWeight.emptyWeight;
|
|
445
|
-
return Number.isFinite(emptyWeight)
|
|
446
|
-
? t('vehicleProps:value.tareWeight', { weight: (emptyWeight).toLocaleString(language) })
|
|
447
|
-
: t('vehicleProps:value.na');
|
|
448
|
-
}
|
|
449
|
-
},
|
|
450
|
-
|
|
451
|
-
maximumWeight: {
|
|
452
|
-
title: t('vehicleProps:title.maximumWeight'),
|
|
453
|
-
get value() {
|
|
454
|
-
const maxWeight = car.sizeVolumeWeight && car.sizeVolumeWeight.maxWeight;
|
|
455
|
-
return Number.isFinite(maxWeight)
|
|
456
|
-
? t('vehicleProps:value.maximumWeightCapacity', { capacity: maxWeight.toLocaleString(language) })
|
|
457
|
-
: t('vehicleProps:value.na');
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
trailerWeightBraked: {
|
|
462
|
-
title: t('vehicleProps:title.trailerLoadBraked'),
|
|
463
|
-
get value() {
|
|
464
|
-
const trailerWeightBraked = car.sizeVolumeWeight && car.sizeVolumeWeight.trailerWeightBraked;
|
|
465
|
-
return Number.isFinite(trailerWeightBraked)
|
|
466
|
-
? t('vehicleProps:value.weight', { weight: trailerWeightBraked.toLocaleString(language) })
|
|
467
|
-
: t('vehicleProps:value.na');
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
trailerWeightUnbraked: {
|
|
472
|
-
title: t('vehicleProps:title.trailerLoadUnbraked'),
|
|
473
|
-
get value() {
|
|
474
|
-
const trailerWeightUnbraked = car.sizeVolumeWeight && car.sizeVolumeWeight.trailerWeightUnbraked;
|
|
475
|
-
return Number.isFinite(trailerWeightUnbraked)
|
|
476
|
-
? t('vehicleProps:value.weight', { weight: trailerWeightUnbraked.toLocaleString(language) })
|
|
477
|
-
: t('vehicleProps:value.na');
|
|
478
|
-
}
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
consumptionInner: {
|
|
482
|
-
icon: 'fuelConsumption',
|
|
483
|
-
title: t('vehicleProps:title.consumptionInner'),
|
|
484
|
-
get value() {
|
|
485
|
-
const consumptionInner = car.consumption.consumptionInner;
|
|
486
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
487
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
488
|
-
return Number.isFinite(consumptionInner)
|
|
489
|
-
? t('vehicleProps:value.consumption', { consumption: consumptionInner.toLocaleString(language), unit: translatedUnit })
|
|
490
|
-
: t('vehicleProps:value.na');
|
|
491
|
-
}
|
|
492
|
-
},
|
|
493
|
-
|
|
494
|
-
consumptionPowerInner: {
|
|
495
|
-
icon: 'fuelConsumption',
|
|
496
|
-
title: t('vehicleProps:title.consumptionPowerInner'),
|
|
497
|
-
get value() {
|
|
498
|
-
const consumptionPowerInner = car.consumption.consumptionInner;
|
|
499
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
500
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
501
|
-
return Number.isFinite(consumptionPowerInner)
|
|
502
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerInner.toLocaleString(language), unit: translatedUnit })
|
|
503
|
-
: t('vehicleProps:value.na');
|
|
504
|
-
}
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
consumptionPowerHybridInner: {
|
|
508
|
-
icon: 'fuelConsumption',
|
|
509
|
-
title: t('vehicleProps:title.consumptionPowerInner'),
|
|
510
|
-
get value() {
|
|
511
|
-
const consumptionPowerInner = car.consumption.consumptionPowerInner;
|
|
512
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
513
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
514
|
-
return Number.isFinite(consumptionPowerInner)
|
|
515
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerInner.toLocaleString(language), unit: translatedUnit })
|
|
516
|
-
: t('vehicleProps:value.na');
|
|
517
|
-
}
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
consumptionHydrogenInner: {
|
|
521
|
-
icon: 'fuelConsumption',
|
|
522
|
-
title: t('vehicleProps:title.consumptionHydrogenInner'),
|
|
523
|
-
get value() {
|
|
524
|
-
const consumptionHydrogenInner = car.consumption.consumptionInner;
|
|
525
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
526
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
527
|
-
return Number.isFinite(consumptionHydrogenInner)
|
|
528
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenInner.toLocaleString(language), unit: translatedUnit })
|
|
529
|
-
: t('vehicleProps:value.na');
|
|
530
|
-
}
|
|
531
|
-
},
|
|
532
|
-
consumptionGasInner: {
|
|
533
|
-
icon: 'fuelConsumption',
|
|
534
|
-
title: t('vehicleProps:title.consumptionGasInner'),
|
|
535
|
-
get value() {
|
|
536
|
-
const consumptionGasInner = car.consumption.consumptionInner;
|
|
537
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
538
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
539
|
-
return Number.isFinite(consumptionGasInner)
|
|
540
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasInner.toLocaleString(language), unit: translatedUnit })
|
|
541
|
-
: t('vehicleProps:value.na');
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
consumptionOuter: {
|
|
546
|
-
icon: 'fuelConsumption',
|
|
547
|
-
title: t('vehicleProps:title.consumptionOuter'),
|
|
548
|
-
get value() {
|
|
549
|
-
const consumptionOuter = car.consumption.consumptionOuter;
|
|
550
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
551
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
552
|
-
return Number.isFinite(consumptionOuter)
|
|
553
|
-
? t('vehicleProps:value.consumption', { consumption: consumptionOuter.toLocaleString(language), unit: translatedUnit })
|
|
554
|
-
: t('vehicleProps:value.na');
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
|
|
558
|
-
consumptionPowerOuter: {
|
|
559
|
-
icon: 'fuelConsumption',
|
|
560
|
-
title: t('vehicleProps:title.consumptionPowerOuter'),
|
|
561
|
-
get value() {
|
|
562
|
-
const consumptionPowerOuter = car.consumption.consumptionOuter;
|
|
563
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
564
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
565
|
-
return Number.isFinite(consumptionPowerOuter)
|
|
566
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerOuter.toLocaleString(language), unit: translatedUnit })
|
|
567
|
-
: t('vehicleProps:value.na');
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
|
|
571
|
-
consumptionPowerHybridOuter: {
|
|
572
|
-
icon: 'fuelConsumption',
|
|
573
|
-
title: t('vehicleProps:title.consumptionPowerOuter'),
|
|
574
|
-
get value() {
|
|
575
|
-
const consumptionPowerOuter = car.consumption.consumptionPowerOuter;
|
|
576
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
577
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
578
|
-
return Number.isFinite(consumptionPowerOuter)
|
|
579
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerOuter.toLocaleString(language), unit: translatedUnit })
|
|
580
|
-
: t('vehicleProps:value.na');
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
|
|
584
|
-
consumptionHydrogenOuter: {
|
|
585
|
-
icon: 'fuelConsumption',
|
|
586
|
-
title: t('vehicleProps:title.consumptionHydrogenOuter'),
|
|
587
|
-
get value() {
|
|
588
|
-
const consumptionHydrogenOuter = car.consumption.consumptionOuter;
|
|
589
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
590
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
591
|
-
return Number.isFinite(consumptionHydrogenOuter)
|
|
592
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenOuter.toLocaleString(language), unit: translatedUnit })
|
|
593
|
-
: t('vehicleProps:value.na');
|
|
594
|
-
}
|
|
595
|
-
},
|
|
596
|
-
|
|
597
|
-
consumptionGasOuter: {
|
|
598
|
-
icon: 'fuelConsumption',
|
|
599
|
-
title: t('vehicleProps:title.consumptionGasOuter'),
|
|
600
|
-
get value() {
|
|
601
|
-
const consumptionGasOuter = car.consumption.consumptionOuter;
|
|
602
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
603
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
604
|
-
return Number.isFinite(consumptionGasOuter)
|
|
605
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasOuter.toLocaleString(language), unit: translatedUnit })
|
|
606
|
-
: t('vehicleProps:value.na');
|
|
607
|
-
}
|
|
608
|
-
},
|
|
609
|
-
|
|
610
|
-
consumptionCombined: {
|
|
611
|
-
icon: 'fuelConsumption',
|
|
612
|
-
title: t('vehicleProps:title.сonsumptionCombined'),
|
|
613
|
-
get value() {
|
|
614
|
-
const consumptionCombined = car.consumption.consumptionCombined;
|
|
615
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
616
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
617
|
-
return Number.isFinite(consumptionCombined)
|
|
618
|
-
? t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
619
|
-
: t('vehicleProps:value.na');
|
|
620
|
-
}
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
consumptionPowerCombined: {
|
|
624
|
-
icon: 'fuelConsumption',
|
|
625
|
-
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
626
|
-
get value() {
|
|
627
|
-
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
628
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
629
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
630
|
-
return Number.isFinite(consumptionPowerCombined)
|
|
631
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
632
|
-
: t('vehicleProps:value.na');
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
|
|
636
|
-
consumptionPowerHybridCombined: {
|
|
637
|
-
icon: 'fuelConsumption',
|
|
638
|
-
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
639
|
-
get value() {
|
|
640
|
-
const consumptionPowerCombined = car.consumption.consumptionPowerCombined;
|
|
641
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
642
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
643
|
-
return Number.isFinite(consumptionPowerCombined)
|
|
644
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
645
|
-
: t('vehicleProps:value.na');
|
|
646
|
-
}
|
|
647
|
-
},
|
|
648
|
-
|
|
649
|
-
consumptionHydrogenCombined: {
|
|
650
|
-
icon: 'fuelConsumption',
|
|
651
|
-
title: t('vehicleProps:title.consumptionHydrogenCombined'),
|
|
652
|
-
get value() {
|
|
653
|
-
const consumptionHydrogenCombined = car.consumption.consumptionCombined;
|
|
654
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
655
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
656
|
-
return Number.isFinite(consumptionHydrogenCombined)
|
|
657
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
658
|
-
: t('vehicleProps:value.na');
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
|
-
|
|
662
|
-
consumptionGasCombined: {
|
|
663
|
-
icon: 'fuelConsumption',
|
|
664
|
-
title: t('vehicleProps:title.consumptionGasCombined'),
|
|
665
|
-
get value() {
|
|
666
|
-
const consumptionGasCombined = car.consumption.consumptionCombined;
|
|
667
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
668
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
669
|
-
return Number.isFinite(consumptionGasCombined)
|
|
670
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
671
|
-
: t('vehicleProps:value.na');
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
consumptionCombinedAlternateView: {
|
|
676
|
-
icon: 'fuelConsumption',
|
|
677
|
-
get value() {
|
|
678
|
-
const consumptionCombined = car.consumption.consumptionCombined;
|
|
679
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
680
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
681
|
-
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
682
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
683
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
684
|
-
|
|
685
|
-
const co2 = car.environmentEmissions.co2;
|
|
686
|
-
|
|
687
|
-
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
688
|
-
? t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
689
|
-
: null;
|
|
690
|
-
|
|
691
|
-
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
692
|
-
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
693
|
-
: null;
|
|
694
|
-
|
|
695
|
-
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
696
|
-
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
697
|
-
: t('vehicleProps:value.na');
|
|
698
|
-
|
|
699
|
-
const co2Value = Number.isFinite(co2)
|
|
700
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
701
|
-
: t('vehicleProps:value.na');
|
|
702
|
-
|
|
703
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
704
|
-
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
705
|
-
: null;
|
|
706
|
-
|
|
707
|
-
if (wltpConsumptionValue && wltpCo2Value) {
|
|
708
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
712
|
-
}
|
|
713
|
-
},
|
|
714
|
-
consumptionPowerCombinedAlternateView: {
|
|
715
|
-
icon: 'fuelConsumption',
|
|
716
|
-
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
717
|
-
get value() {
|
|
718
|
-
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
719
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
720
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
721
|
-
const co2 = car.environmentEmissions.co2;
|
|
722
|
-
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
723
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
724
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
725
|
-
|
|
726
|
-
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
727
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
728
|
-
: null;
|
|
729
|
-
|
|
730
|
-
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
731
|
-
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
732
|
-
: null;
|
|
733
|
-
|
|
734
|
-
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
735
|
-
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
736
|
-
: t('vehicleProps:value.na');
|
|
737
|
-
|
|
738
|
-
const co2Value = Number.isFinite(co2)
|
|
739
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
740
|
-
: t('vehicleProps:value.na');
|
|
741
|
-
|
|
742
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
743
|
-
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
744
|
-
: null;
|
|
745
|
-
|
|
746
|
-
if (wltpConsumptionValue && wltpCo2Value) {
|
|
747
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
consumptionHydrogenCombinedAlternateView: {
|
|
754
|
-
icon: 'fuelConsumption',
|
|
755
|
-
title: t('vehicleProps:title.consumptionHydrogenCombined'),
|
|
756
|
-
get value() {
|
|
757
|
-
const consumptionHydrogenCombined = car.consumption.consumptionCombined;
|
|
758
|
-
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
759
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
760
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
761
|
-
const co2 = car.environmentEmissions.co2;
|
|
762
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
763
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
764
|
-
|
|
765
|
-
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
766
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
767
|
-
: t('vehicleProps:value.na');
|
|
768
|
-
|
|
769
|
-
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
770
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
771
|
-
: null;
|
|
772
|
-
|
|
773
|
-
const co2Value = Number.isFinite(co2)
|
|
774
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
775
|
-
: t('vehicleProps:value.na');
|
|
776
|
-
|
|
777
|
-
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
778
|
-
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
779
|
-
: null;
|
|
780
|
-
|
|
781
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
782
|
-
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
783
|
-
: null;
|
|
784
|
-
|
|
785
|
-
if (wltpConsumptionValue && wltpCo2Value) {
|
|
786
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
790
|
-
}
|
|
791
|
-
},
|
|
792
|
-
consumptionGasCombinedAlternateView: {
|
|
793
|
-
icon: 'fuelConsumption',
|
|
794
|
-
title: t('vehicleProps:title.consumptionGasCombined'),
|
|
795
|
-
get value() {
|
|
796
|
-
const consumptionGasCombined = car.consumption.consumptionCombined;
|
|
797
|
-
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
798
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
799
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
800
|
-
|
|
801
|
-
const co2 = car.environmentEmissions.co2;
|
|
802
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
803
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
804
|
-
|
|
805
|
-
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
806
|
-
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
807
|
-
: t('vehicleProps:value.na');
|
|
808
|
-
|
|
809
|
-
const co2Value = Number.isFinite(co2)
|
|
810
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
811
|
-
: t('vehicleProps:value.na');
|
|
812
|
-
|
|
813
|
-
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
814
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
815
|
-
: null;
|
|
816
|
-
|
|
817
|
-
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
818
|
-
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
819
|
-
: null;
|
|
820
|
-
|
|
821
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
822
|
-
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
823
|
-
: null;
|
|
824
|
-
|
|
825
|
-
if (wltpConsumptionValue && wltpCo2Value) {
|
|
826
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
830
|
-
}
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
consumptionCombinedHybridAlternateView: {
|
|
834
|
-
icon: 'fuelConsumption',
|
|
835
|
-
get value() {
|
|
836
|
-
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
837
|
-
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
838
|
-
// const wltpPowerCombined = car.consumption.wltpPowerCombined || car.consumption.wltpWeightedPowerCombined;
|
|
839
|
-
const wltpCombined = car.consumption.wltpCombined;
|
|
840
|
-
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
841
|
-
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
842
|
-
|
|
843
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
844
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
845
|
-
|
|
846
|
-
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
847
|
-
// const wltpConsumptionPowerCombinedContent = wltpPowerCombined
|
|
848
|
-
// ? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
849
|
-
// : null;
|
|
850
|
-
|
|
851
|
-
const wltpConsumptionWeightedPowerCombinedContent = wltpWeightedPowerCombined
|
|
852
|
-
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
853
|
-
: null;
|
|
854
|
-
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
855
|
-
const wltpConsumptionCombinedContent = wltpCombined ?
|
|
856
|
-
t('vehicleProps:value.consumptionCombined', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
857
|
-
: null;
|
|
858
|
-
const wltpConsumptionWeightedCombinedContent = wltpWeightedCombined ?
|
|
859
|
-
t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
860
|
-
: null;
|
|
861
|
-
|
|
862
|
-
const co2 = car.environmentEmissions.co2;
|
|
863
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
864
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
865
|
-
const co2Value = Number.isFinite(co2)
|
|
866
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
867
|
-
: t('vehicleProps:value.na');
|
|
868
|
-
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
869
|
-
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
870
|
-
: null;
|
|
871
|
-
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
872
|
-
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
873
|
-
: null;
|
|
874
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
875
|
-
? t('vehicleProps:value.co2Class', { class: wltpEnergyEfficiencyClass })
|
|
876
|
-
: null;
|
|
877
|
-
const hybridPlugin = car.engineData.hybridPlugin;
|
|
878
|
-
|
|
879
|
-
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
880
|
-
return <React.Fragment>
|
|
881
|
-
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
|
|
882
|
-
{wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
|
|
883
|
-
{wrapValue(wltpCo2PluginValue)}
|
|
884
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
885
|
-
</React.Fragment>
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
889
|
-
return <React.Fragment>
|
|
890
|
-
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
891
|
-
{wrapValue(wltpCo2Value)}
|
|
892
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
893
|
-
</React.Fragment>
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
return Number.isFinite(consumptionCombined) && Number.isFinite(consumptionPowerCombined)
|
|
897
|
-
? <React.Fragment>
|
|
898
|
-
{consumptionPowerCombined && hybridPlugin ? wrapValue(consumptionPowerCombinedContent) : ''}
|
|
899
|
-
{consumptionPowerCombined && hybridPlugin ? <br /> : ''}
|
|
900
|
-
{wrapValue(consumptionCombinedContent)} <br />
|
|
901
|
-
{wrapValue(co2Value)}
|
|
902
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
903
|
-
</React.Fragment>
|
|
904
|
-
: t('vehicleProps:value.na');
|
|
905
|
-
}
|
|
906
|
-
},
|
|
907
|
-
|
|
908
|
-
rangeHydrogen: {
|
|
909
|
-
title: t('vehicleProps:title.rangeHydrogen'),
|
|
910
|
-
get value() {
|
|
911
|
-
const { rangeHydrogen } = car.engineData;
|
|
912
|
-
return Number.isFinite(rangeHydrogen)
|
|
913
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: rangeHydrogen.toLocaleString(language) })
|
|
914
|
-
: t('vehicleProps:value.na');
|
|
915
|
-
}
|
|
916
|
-
},
|
|
917
|
-
batteryRangeElectric: {
|
|
918
|
-
title: t('vehicleProps:title.batteryRangeElectric'),
|
|
919
|
-
get value() {
|
|
920
|
-
const batteryRangeElectric = car.battery && car.battery.batteryRangeElectric;
|
|
921
|
-
return Number.isFinite(batteryRangeElectric)
|
|
922
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: batteryRangeElectric.toLocaleString(language) })
|
|
923
|
-
: t('vehicleProps:value.na');
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
c02: {
|
|
928
|
-
title: t('vehicleProps:title.co2'),
|
|
929
|
-
get value() {
|
|
930
|
-
const c02 = car.environmentEmissions.co2;
|
|
931
|
-
return Number.isFinite(c02)
|
|
932
|
-
? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
|
|
933
|
-
: t('vehicleProps:value.na');
|
|
934
|
-
}
|
|
935
|
-
},
|
|
936
|
-
|
|
937
|
-
consumptionAndCo2: {
|
|
938
|
-
title: t('vehicleProps:title.consumptionAndCo2'),
|
|
939
|
-
get value() {
|
|
940
|
-
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
941
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
942
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
943
|
-
const co2 = car.environmentEmissions.co2;
|
|
944
|
-
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
945
|
-
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
946
|
-
: t('vehicleProps:value.na');
|
|
947
|
-
const co2Value = Number.isFinite(co2)
|
|
948
|
-
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
949
|
-
: t('vehicleProps:value.na');
|
|
950
|
-
|
|
951
|
-
return `${consumptionValue} | ${co2Value}`;
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
emissionClass: {
|
|
955
|
-
title: t('vehicleProps:title.emissionClass'),
|
|
956
|
-
get value() {
|
|
957
|
-
const emissionClass = car.environmentEmissions.emissionClass;
|
|
958
|
-
return isPropDefined(emissionClass) ? t(`cbd:${emissionClass}`) : t('vehicleProps:value.na');
|
|
959
|
-
}
|
|
960
|
-
},
|
|
961
|
-
|
|
962
|
-
emissionSticker: {
|
|
963
|
-
title: t('vehicleProps:title.emissionsSticker'),
|
|
964
|
-
get value() {
|
|
965
|
-
const emissionSticker = car.environmentEmissions.emissionSticker;
|
|
966
|
-
let icon = null;
|
|
967
|
-
const size = 25;
|
|
968
|
-
|
|
969
|
-
if (emissionSticker !== 'selector_emissionSticker_no') {
|
|
970
|
-
icon = EMISSION_STICKERS_ICONS[emissionSticker];
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
return icon ? <Icon src={icon} width={size} height={size} /> : t('vehicleProps:value.na');
|
|
974
|
-
}
|
|
975
|
-
},
|
|
976
|
-
|
|
977
|
-
wpEmissionSticker: {
|
|
978
|
-
title: t('vehicleProps:title.emissionsSticker'),
|
|
979
|
-
get value() {
|
|
980
|
-
const emissionSticker = car.environmentEmissions.emissionSticker;
|
|
981
|
-
let icon = null;
|
|
982
|
-
const size = 25;
|
|
983
|
-
|
|
984
|
-
if (emissionSticker !== 'selector_emissionSticker_no') {
|
|
985
|
-
icon = WP_EMISSION_STICKERS_ICONS[emissionSticker];
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
return icon ? <Icon src={icon} width={size} height={size} /> : t('vehicleProps:value.na');
|
|
989
|
-
}
|
|
990
|
-
},
|
|
991
|
-
|
|
992
|
-
energyEfficiencyClass: {
|
|
993
|
-
title: t('vehicleProps:title.energyEfficiencyClass'),
|
|
994
|
-
subTitle: t('vehicleProps:title.subTitle'),
|
|
995
|
-
get value() {
|
|
996
|
-
const level = car.environmentEmissions.energyEfficiencyClass;
|
|
997
|
-
return isPropDefined(level) ? <CO2Efficiency level={level} t={t} /> : t('vehicleProps:value.na');
|
|
998
|
-
}
|
|
999
|
-
},
|
|
1000
|
-
|
|
1001
|
-
offerAvailability: {
|
|
1002
|
-
title: t('vehicleProps:title.offerAvailability'),
|
|
1003
|
-
icon: 'carAvailability',
|
|
1004
|
-
get value() {
|
|
1005
|
-
const offerAvailabilityMode = offer.availabilityMode;
|
|
1006
|
-
const offerAvailabilityTimestamp = offer.availabilityFrom;
|
|
1007
|
-
const humanViewTime = moment.unix(offerAvailabilityTimestamp).format('DD.MM.YYYY');
|
|
1008
|
-
let offerAvailability: string;
|
|
1009
|
-
|
|
1010
|
-
switch (offerAvailabilityMode) {
|
|
1011
|
-
case 'selector_availabilityMode_always':
|
|
1012
|
-
offerAvailability = t(`cbd:${offerAvailabilityMode}`);
|
|
1013
|
-
break;
|
|
1014
|
-
|
|
1015
|
-
case 'selector_availabilityMode_fromDate':
|
|
1016
|
-
if (offer.deliveryPeriod != null && offer.deliveryPeriod !== 'selector_unknown') {
|
|
1017
|
-
offerAvailability = formatDeliveryPeriod(t, offer.deliveryPeriod);
|
|
1018
|
-
break;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
if (moment.utc(offerAvailabilityTimestamp, 'X').isBefore()) {
|
|
1022
|
-
offerAvailability = t('cbd:selector_availabilityMode_always');
|
|
1023
|
-
} else if (!!offerAvailabilityTimestamp) {
|
|
1024
|
-
offerAvailability = t('vehicleProps:value.fromDate', { date: humanViewTime });
|
|
1025
|
-
} else {
|
|
1026
|
-
offerAvailability = t('vehicleProps:value.onRequest'); // case when "availabilityFrom" is undefined
|
|
1027
|
-
}
|
|
1028
|
-
break;
|
|
1029
|
-
|
|
1030
|
-
default:
|
|
1031
|
-
if (!offerAvailabilityMode && !firstRegistration && !mileage) offerAvailability = t('vehicleProps:value.onRequest');
|
|
1032
|
-
else offerAvailability = null;
|
|
1033
|
-
}
|
|
1034
|
-
return isPropDefined(offerAvailability) ? offerAvailability : t('vehicleProps:value.na');
|
|
1035
|
-
}
|
|
1036
|
-
},
|
|
1037
|
-
|
|
1038
|
-
lastTechnicalService: {
|
|
1039
|
-
title: t('vehicleProps:title.lastTechnicalService'),
|
|
1040
|
-
get value() {
|
|
1041
|
-
const lastTechnicalService = car.careService.lastTechnicalService;
|
|
1042
|
-
return Number.isFinite(lastTechnicalService)
|
|
1043
|
-
? formatTimestamp({ timestamp: lastTechnicalService, format: 'MM/YYYY' })
|
|
1044
|
-
: t('vehicleProps:value.na');
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
|
|
1048
|
-
generalInspection: {
|
|
1049
|
-
title: t('vehicleProps:title.generalInspection'),
|
|
1050
|
-
get value() {
|
|
1051
|
-
const generalInspection = car.careService.generalInspection;
|
|
1052
|
-
if (car.offer.newHuAu) {
|
|
1053
|
-
return t('vehicleProps:value.new');
|
|
1054
|
-
// tslint:disable-next-line:no-else-after-return
|
|
1055
|
-
}else {
|
|
1056
|
-
return Number.isFinite(generalInspection)
|
|
1057
|
-
? formatTimestamp({ timestamp: generalInspection, format: 'MM/YYYY' })
|
|
1058
|
-
: t('vehicleProps:value.na');
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
},
|
|
1062
|
-
|
|
1063
|
-
condition: {
|
|
1064
|
-
title: t('vehicleProps:title.сondition'),
|
|
1065
|
-
get value() {
|
|
1066
|
-
return isPropDefined(condition)
|
|
1067
|
-
? t(`cbd:${condition}`)
|
|
1068
|
-
: t('vehicleProps:value.na');
|
|
1069
|
-
}
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1072
|
-
numberOfPreviousOwnersSimple: {
|
|
1073
|
-
title: t('vehicleProps:title.numberOfPreviousOwners'),
|
|
1074
|
-
get value() {
|
|
1075
|
-
return Number.isFinite(numberOfPreviousOwners)
|
|
1076
|
-
? numberOfPreviousOwners
|
|
1077
|
-
: t('vehicleProps:value.na');
|
|
1078
|
-
}
|
|
1079
|
-
},
|
|
1080
|
-
|
|
1081
|
-
guarantee: {
|
|
1082
|
-
title: t('vehicleProps:title.guarantee'),
|
|
1083
|
-
get value() {
|
|
1084
|
-
const guarantee = car.offer.warranty;
|
|
1085
|
-
return isPropDefined(guarantee)
|
|
1086
|
-
? (guarantee ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1087
|
-
: t('vehicleProps:value.na');
|
|
1088
|
-
}
|
|
1089
|
-
},
|
|
1090
|
-
|
|
1091
|
-
maintenanceGuide: {
|
|
1092
|
-
title: t('vehicleProps:title.maintenanceGuide'),
|
|
1093
|
-
get value() {
|
|
1094
|
-
const fullserviceHistory = car.careService.fullServiceHistory;
|
|
1095
|
-
return isPropDefined(fullserviceHistory)
|
|
1096
|
-
? (fullserviceHistory ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1097
|
-
: t('vehicleProps:value.na');
|
|
1098
|
-
}
|
|
1099
|
-
},
|
|
1100
|
-
|
|
1101
|
-
nonSmokerVehicle: {
|
|
1102
|
-
title: t('vehicleProps:title.nonSmokingVehicle'),
|
|
1103
|
-
get value() {
|
|
1104
|
-
return isPropDefined(nonSmokerVehicle)
|
|
1105
|
-
? (nonSmokerVehicle ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1106
|
-
: t('vehicleProps:value.na');
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
|
|
1110
|
-
manufacturerColorName: {
|
|
1111
|
-
title: t('vehicleProps:title.manufacturerColorName'),
|
|
1112
|
-
get value() {
|
|
1113
|
-
const color = car.exterior.manufacturerColorName;
|
|
1114
|
-
|
|
1115
|
-
if (typeof color !== 'string' || color === '') {
|
|
1116
|
-
return t('vehicleProps:value.na');
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
return color[0].toUpperCase() + color.slice(1);
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
|
-
|
|
1123
|
-
exteriorColor: {
|
|
1124
|
-
title: t('vehicleProps:title.colour'),
|
|
1125
|
-
get value() {
|
|
1126
|
-
const exteriorColor = car.exterior.exteriorColor;
|
|
1127
|
-
return isPropDefined(exteriorColor)
|
|
1128
|
-
? t(`cbd:${exteriorColor.replace('exterior_', '')}`)
|
|
1129
|
-
: t('vehicleProps:value.na');
|
|
1130
|
-
}
|
|
1131
|
-
},
|
|
1132
|
-
|
|
1133
|
-
appointmentsColor: {
|
|
1134
|
-
title: t('vehicleProps:title.appointmentsColor'),
|
|
1135
|
-
get value() {
|
|
1136
|
-
const interiorColor = car.interior.interiorColor;
|
|
1137
|
-
return isPropDefined(interiorColor)
|
|
1138
|
-
? t(`cbd:${interiorColor.replace('interior_', '')}`)
|
|
1139
|
-
: t('vehicleProps:value.na');
|
|
1140
|
-
}
|
|
1141
|
-
},
|
|
1142
|
-
|
|
1143
|
-
interiorType: {
|
|
1144
|
-
title: t('vehicleProps:title.interiorType'),
|
|
1145
|
-
get value() {
|
|
1146
|
-
const interiorType = car.interior.interiorType;
|
|
1147
|
-
return isPropDefined(interiorType)
|
|
1148
|
-
? t(`cbd:${interiorType}`)
|
|
1149
|
-
: t('vehicleProps:value.na');
|
|
1150
|
-
}
|
|
1151
|
-
},
|
|
1152
|
-
signOfUse : {
|
|
1153
|
-
title: t('vehicleProps:title.signsOfUse'),
|
|
1154
|
-
isVisible: mileage > 100, // tslint:disable-line
|
|
1155
|
-
isLongTitle: true,
|
|
1156
|
-
get value() {
|
|
1157
|
-
return t('vehicleProps:value.yes');
|
|
1158
|
-
}
|
|
1159
|
-
},
|
|
1160
|
-
countryVersion : {
|
|
1161
|
-
title: t('vehicleProps:title.countryVersion'),
|
|
1162
|
-
get value() {
|
|
1163
|
-
const countryName = car.countryActive[language];
|
|
1164
|
-
if (!countryVersion) return t('vehicleProps:value.na');
|
|
1165
|
-
switch (countryVersion) {
|
|
1166
|
-
case 'de':
|
|
1167
|
-
return t('vehicleProps:value.countryDEversion');
|
|
1168
|
-
break;
|
|
1169
|
-
case 'eu':
|
|
1170
|
-
return t('vehicleProps:value.countryEUversion');
|
|
1171
|
-
break;
|
|
1172
|
-
case 'at':
|
|
1173
|
-
return t('vehicleProps:value.countryATversion');
|
|
1174
|
-
break;
|
|
1175
|
-
default:
|
|
1176
|
-
return t('vehicleProps:value.countryVersionName', { countryName });
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
},
|
|
1180
|
-
wltpCo2: {
|
|
1181
|
-
title: t('vehicleProps:title.wltpCo2'),
|
|
1182
|
-
get value() {
|
|
1183
|
-
const c02 = car.environmentEmissions.wltpCo2;
|
|
1184
|
-
return Number.isFinite(c02)
|
|
1185
|
-
? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
|
|
1186
|
-
: t('vehicleProps:value.na');
|
|
1187
|
-
}
|
|
1188
|
-
},
|
|
1189
|
-
wltpCo2Plugin: {
|
|
1190
|
-
title: t('vehicleProps:title.wltpCo2Plugin'),
|
|
1191
|
-
get value() {
|
|
1192
|
-
const c02 = car.environmentEmissions.wltpCo2;
|
|
1193
|
-
return Number.isFinite(c02)
|
|
1194
|
-
? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
|
|
1195
|
-
: t('vehicleProps:value.na');
|
|
1196
|
-
}
|
|
1197
|
-
},
|
|
1198
|
-
wltpCo2Discharged: {
|
|
1199
|
-
title: t('vehicleProps:title.wltpCo2Discharged'),
|
|
1200
|
-
get value() {
|
|
1201
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
|
|
1202
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1203
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1204
|
-
return Number.isFinite(wltpCo2)
|
|
1205
|
-
? t('vehicleProps:value.wltpCo2', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
|
|
1206
|
-
: t('vehicleProps:value.na');
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
wltpEnergyEfficiencyClass: {
|
|
1210
|
-
// title: t('vehicleProps:title.wltpEnergyEfficiencyClass'),
|
|
1211
|
-
// subTitle: t('vehicleProps:title.subTitle'),
|
|
1212
|
-
get value() {
|
|
1213
|
-
const level = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
1214
|
-
const wltpLevel = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1215
|
-
const { hybridPlugin } = car.engineData;
|
|
1216
|
-
const subtitle = hybridPlugin ? t('vehicleProps:title.wltpCO2SubTitle') : t('vehicleProps:title.wltpCO2SubTitleComb');
|
|
1217
|
-
return isPropDefined(level) ?
|
|
1218
|
-
<CO2Efficiency
|
|
1219
|
-
title={t('vehicleProps:title.wltpCO2Title')}
|
|
1220
|
-
subTitle={subtitle}
|
|
1221
|
-
wltpLevel={wltpLevel}
|
|
1222
|
-
level={level}
|
|
1223
|
-
t={t}
|
|
1224
|
-
levelTitle={t('vehicleProps:title.wltpCO2WidgetComb')}
|
|
1225
|
-
wltpLevelTitle={t('vehicleProps:title.wltpCO2WidgetDischargedBattery')}
|
|
1226
|
-
hybridPlugin={hybridPlugin}
|
|
1227
|
-
isWltp
|
|
1228
|
-
/> : t('vehicleProps:value.na');
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
wltpDischargedEnergyEfficiencyClass: {
|
|
1232
|
-
title: t('vehicleProps:title.wltpDischargedEnergyEfficiencyClass'),
|
|
1233
|
-
subTitle: t('vehicleProps:title.subTitle'),
|
|
1234
|
-
get value() {
|
|
1235
|
-
const level = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1236
|
-
return isPropDefined(level) ? <CO2Efficiency level={level} isWltp t={t} /> : t('vehicleProps:value.na');
|
|
1237
|
-
}
|
|
1238
|
-
},
|
|
1239
|
-
wltpRange: {
|
|
1240
|
-
title: t('vehicleProps:title.wltpRange'),
|
|
1241
|
-
get value() {
|
|
1242
|
-
const wltpRange = car.battery && car.battery.wltpRange;
|
|
1243
|
-
return Number.isFinite(wltpRange)
|
|
1244
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRange.toLocaleString(language) })
|
|
1245
|
-
: t('vehicleProps:value.na');
|
|
1246
|
-
}
|
|
1247
|
-
},
|
|
1248
|
-
wltpTotalRange: {
|
|
1249
|
-
title: t('vehicleProps:title.wltpTotalRange'),
|
|
1250
|
-
get value() {
|
|
1251
|
-
const wltpTotalRange = car.battery && car.battery.wltpTotalRange;
|
|
1252
|
-
return Number.isFinite(wltpTotalRange)
|
|
1253
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRange.toLocaleString(language) })
|
|
1254
|
-
: t('vehicleProps:value.na');
|
|
1255
|
-
}
|
|
1256
|
-
},
|
|
1257
|
-
|
|
1258
|
-
wltpRangeCity: {
|
|
1259
|
-
title: t('vehicleProps:title.wltpRangeCity'),
|
|
1260
|
-
get value() {
|
|
1261
|
-
const wltpRangeCity = car.battery && car.battery.wltpRangeCity;
|
|
1262
|
-
return Number.isFinite(wltpRangeCity)
|
|
1263
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRangeCity.toLocaleString(language) })
|
|
1264
|
-
: t('vehicleProps:value.na');
|
|
1265
|
-
}
|
|
1266
|
-
},
|
|
1267
|
-
wltpTotalRangeCity: {
|
|
1268
|
-
title: t('vehicleProps:title.wltpTotalRangeCity'),
|
|
1269
|
-
get value() {
|
|
1270
|
-
const wltpTotalRangeCity = car.battery && car.battery.wltpTotalRangeCity;
|
|
1271
|
-
return Number.isFinite(wltpTotalRangeCity)
|
|
1272
|
-
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRangeCity.toLocaleString(language) })
|
|
1273
|
-
: t('vehicleProps:value.na');
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
wltpWeightedCombined: {
|
|
1277
|
-
title: t('vehicleProps:title.wltpWeightedCombined'),
|
|
1278
|
-
get value() {
|
|
1279
|
-
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
1280
|
-
return Number.isFinite(wltpWeightedCombined)
|
|
1281
|
-
? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language) })
|
|
1282
|
-
: t('vehicleProps:value.na');
|
|
1283
|
-
}
|
|
1284
|
-
},
|
|
1285
|
-
wltpCombined: {
|
|
1286
|
-
title: t('vehicleProps:title.wltpCombined'),
|
|
1287
|
-
get value() {
|
|
1288
|
-
const wltpCombined = car.consumption.wltpCombined;
|
|
1289
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1290
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1291
|
-
return Number.isFinite(wltpCombined)
|
|
1292
|
-
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1293
|
-
: t('vehicleProps:value.na');
|
|
1294
|
-
}
|
|
1295
|
-
},
|
|
1296
|
-
wltpCombinedGas: {
|
|
1297
|
-
title: t('vehicleProps:title.wltpCombined'),
|
|
1298
|
-
get value() {
|
|
1299
|
-
const wltpCombined = car.consumption.wltpCombined;
|
|
1300
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1301
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1302
|
-
return Number.isFinite(wltpCombined)
|
|
1303
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1304
|
-
: t('vehicleProps:value.na');
|
|
1305
|
-
}
|
|
1306
|
-
},
|
|
1307
|
-
wltpCombinedPlugin: {
|
|
1308
|
-
title: t('vehicleProps:title.wltpCombinedPlugin'),
|
|
1309
|
-
get value() {
|
|
1310
|
-
const wltpCombined = car.consumption.wltpCombined;
|
|
1311
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1312
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1313
|
-
return Number.isFinite(wltpCombined)
|
|
1314
|
-
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1315
|
-
: t('vehicleProps:value.na');
|
|
1316
|
-
}
|
|
1317
|
-
},
|
|
1318
|
-
wltpSlow: {
|
|
1319
|
-
title: t('vehicleProps:title.wltpSlow'),
|
|
1320
|
-
get value() {
|
|
1321
|
-
const wltpSlow = car.consumption.wltpSlow;
|
|
1322
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1323
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1324
|
-
return Number.isFinite(wltpSlow)
|
|
1325
|
-
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1326
|
-
: t('vehicleProps:value.na');
|
|
1327
|
-
}
|
|
1328
|
-
},
|
|
1329
|
-
wltpSlowGas: {
|
|
1330
|
-
title: t('vehicleProps:title.wltpSlow'),
|
|
1331
|
-
get value() {
|
|
1332
|
-
const wltpSlow = car.consumption.wltpSlow;
|
|
1333
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1334
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1335
|
-
return Number.isFinite(wltpSlow)
|
|
1336
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1337
|
-
: t('vehicleProps:value.na');
|
|
1338
|
-
}
|
|
1339
|
-
},
|
|
1340
|
-
wltpSlowPlugin: {
|
|
1341
|
-
title: t('vehicleProps:title.wltpSlowPlugin'),
|
|
1342
|
-
get value() {
|
|
1343
|
-
const wltpSlow = car.consumption.wltpSlow;
|
|
1344
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1345
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1346
|
-
return Number.isFinite(wltpSlow)
|
|
1347
|
-
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1348
|
-
: t('vehicleProps:value.na');
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
|
-
wltpMedium: {
|
|
1352
|
-
title: t('vehicleProps:title.wltpMedium'),
|
|
1353
|
-
get value() {
|
|
1354
|
-
const wltpMedium = car.consumption.wltpMedium;
|
|
1355
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1356
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1357
|
-
return Number.isFinite(wltpMedium)
|
|
1358
|
-
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1359
|
-
: t('vehicleProps:value.na');
|
|
1360
|
-
}
|
|
1361
|
-
},
|
|
1362
|
-
wltpMediumGas: {
|
|
1363
|
-
title: t('vehicleProps:title.wltpMedium'),
|
|
1364
|
-
get value() {
|
|
1365
|
-
const wltpMedium = car.consumption.wltpMedium;
|
|
1366
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1367
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1368
|
-
return Number.isFinite(wltpMedium)
|
|
1369
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1370
|
-
: t('vehicleProps:value.na');
|
|
1371
|
-
}
|
|
1372
|
-
},
|
|
1373
|
-
wltpMediumPlugin: {
|
|
1374
|
-
title: t('vehicleProps:title.wltpMediumPlugin'),
|
|
1375
|
-
get value() {
|
|
1376
|
-
const wltpMedium = car.consumption.wltpMedium;
|
|
1377
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1378
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1379
|
-
return Number.isFinite(wltpMedium)
|
|
1380
|
-
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1381
|
-
: t('vehicleProps:value.na');
|
|
1382
|
-
}
|
|
1383
|
-
},
|
|
1384
|
-
wltpFast: {
|
|
1385
|
-
title: t('vehicleProps:title.wltpFast'),
|
|
1386
|
-
get value() {
|
|
1387
|
-
const wltpFast = car.consumption.wltpFast;
|
|
1388
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1389
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1390
|
-
return Number.isFinite(wltpFast)
|
|
1391
|
-
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1392
|
-
: t('vehicleProps:value.na');
|
|
1393
|
-
}
|
|
1394
|
-
},
|
|
1395
|
-
wltpFastGas: {
|
|
1396
|
-
title: t('vehicleProps:title.wltpFast'),
|
|
1397
|
-
get value() {
|
|
1398
|
-
const wltpFast = car.consumption.wltpFast;
|
|
1399
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1400
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1401
|
-
return Number.isFinite(wltpFast)
|
|
1402
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1403
|
-
: t('vehicleProps:value.na');
|
|
1404
|
-
}
|
|
1405
|
-
},
|
|
1406
|
-
wltpFastPlugin: {
|
|
1407
|
-
title: t('vehicleProps:title.wltpFastPlugin'),
|
|
1408
|
-
get value() {
|
|
1409
|
-
const wltpFast = car.consumption.wltpFast;
|
|
1410
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1411
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1412
|
-
return Number.isFinite(wltpFast)
|
|
1413
|
-
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1414
|
-
: t('vehicleProps:value.na');
|
|
1415
|
-
}
|
|
1416
|
-
},
|
|
1417
|
-
wltpVeryFast: {
|
|
1418
|
-
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1419
|
-
get value() {
|
|
1420
|
-
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1421
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1422
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1423
|
-
return Number.isFinite(wltpVeryFast)
|
|
1424
|
-
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1425
|
-
: t('vehicleProps:value.na');
|
|
1426
|
-
}
|
|
1427
|
-
},
|
|
1428
|
-
wltpVeryFastGas: {
|
|
1429
|
-
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1430
|
-
get value() {
|
|
1431
|
-
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1432
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1433
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1434
|
-
return Number.isFinite(wltpVeryFast)
|
|
1435
|
-
? t('vehicleProps:value.consumptionGas', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1436
|
-
: t('vehicleProps:value.na');
|
|
1437
|
-
}
|
|
1438
|
-
},
|
|
1439
|
-
wltpVeryFastPlugin: {
|
|
1440
|
-
title: t('vehicleProps:title.wltpVeryFastPlugin'),
|
|
1441
|
-
get value() {
|
|
1442
|
-
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1443
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1444
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1445
|
-
return Number.isFinite(wltpVeryFast)
|
|
1446
|
-
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1447
|
-
: t('vehicleProps:value.na');
|
|
1448
|
-
}
|
|
1449
|
-
},
|
|
1450
|
-
wltpWeightedPowerCombined: {
|
|
1451
|
-
title: t('vehicleProps:title.wltpWeightedPowerCombined'),
|
|
1452
|
-
get value() {
|
|
1453
|
-
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
1454
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1455
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1456
|
-
return Number.isFinite(wltpWeightedPowerCombined)
|
|
1457
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1458
|
-
: t('vehicleProps:value.na');
|
|
1459
|
-
}
|
|
1460
|
-
},
|
|
1461
|
-
wltpPowerCombined: {
|
|
1462
|
-
title: t('vehicleProps:title.wltpPowerCombined'),
|
|
1463
|
-
get value() {
|
|
1464
|
-
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1465
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1466
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1467
|
-
return Number.isFinite(wltpPowerCombined)
|
|
1468
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1469
|
-
: t('vehicleProps:value.na');
|
|
1470
|
-
}
|
|
1471
|
-
},
|
|
1472
|
-
wltpPowerSlow: {
|
|
1473
|
-
title: t('vehicleProps:title.wltpPowerSlow'),
|
|
1474
|
-
get value() {
|
|
1475
|
-
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1476
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1477
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1478
|
-
return Number.isFinite(wltpPowerSlow)
|
|
1479
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1480
|
-
: t('vehicleProps:value.na');
|
|
1481
|
-
}
|
|
1482
|
-
},
|
|
1483
|
-
wltpPowerMedium: {
|
|
1484
|
-
title: t('vehicleProps:title.wltpPowerMedium'),
|
|
1485
|
-
get value() {
|
|
1486
|
-
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1487
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1488
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1489
|
-
return Number.isFinite(wltpPowerMedium)
|
|
1490
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1491
|
-
: t('vehicleProps:value.na');
|
|
1492
|
-
}
|
|
1493
|
-
},
|
|
1494
|
-
wltpPowerFast: {
|
|
1495
|
-
title: t('vehicleProps:title.wltpPowerFast'),
|
|
1496
|
-
get value() {
|
|
1497
|
-
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1498
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1499
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1500
|
-
return Number.isFinite(wltpPowerFast)
|
|
1501
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1502
|
-
: t('vehicleProps:value.na');
|
|
1503
|
-
}
|
|
1504
|
-
},
|
|
1505
|
-
wltpPowerVeryFast: {
|
|
1506
|
-
title: t('vehicleProps:title.wltpPowerVeryFast'),
|
|
1507
|
-
get value() {
|
|
1508
|
-
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1509
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1510
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1511
|
-
return Number.isFinite(wltpPowerVeryFast)
|
|
1512
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1513
|
-
: t('vehicleProps:value.na');
|
|
1514
|
-
}
|
|
1515
|
-
},
|
|
1516
|
-
wltpPowerCombinedPlugin: {
|
|
1517
|
-
title: t('vehicleProps:title.wltpPowerCombined'),
|
|
1518
|
-
get value() {
|
|
1519
|
-
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1520
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1521
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1522
|
-
return Number.isFinite(wltpPowerCombined)
|
|
1523
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1524
|
-
: t('vehicleProps:value.na');
|
|
1525
|
-
}
|
|
1526
|
-
},
|
|
1527
|
-
wltpPowerSlowPlugin: {
|
|
1528
|
-
title: t('vehicleProps:title.wltpPowerSlow'),
|
|
1529
|
-
get value() {
|
|
1530
|
-
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1531
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1532
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1533
|
-
return Number.isFinite(wltpPowerSlow)
|
|
1534
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1535
|
-
: t('vehicleProps:value.na');
|
|
1536
|
-
}
|
|
1537
|
-
},
|
|
1538
|
-
wltpPowerMediumPlugin: {
|
|
1539
|
-
title: t('vehicleProps:title.wltpPowerMedium'),
|
|
1540
|
-
get value() {
|
|
1541
|
-
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1542
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1543
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1544
|
-
return Number.isFinite(wltpPowerMedium)
|
|
1545
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1546
|
-
: t('vehicleProps:value.na');
|
|
1547
|
-
}
|
|
1548
|
-
},
|
|
1549
|
-
wltpPowerFastPlugin: {
|
|
1550
|
-
title: t('vehicleProps:title.wltpPowerFast'),
|
|
1551
|
-
get value() {
|
|
1552
|
-
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1553
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1554
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1555
|
-
return Number.isFinite(wltpPowerFast)
|
|
1556
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1557
|
-
: t('vehicleProps:value.na');
|
|
1558
|
-
}
|
|
1559
|
-
},
|
|
1560
|
-
wltpPowerVeryFastPlugin: {
|
|
1561
|
-
title: t('vehicleProps:title.wltpPowerVeryFast'),
|
|
1562
|
-
get value() {
|
|
1563
|
-
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1564
|
-
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1565
|
-
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1566
|
-
return Number.isFinite(wltpPowerVeryFast)
|
|
1567
|
-
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1568
|
-
: t('vehicleProps:value.na');
|
|
1569
|
-
}
|
|
1570
|
-
},
|
|
1571
|
-
wltpEnergyCosts: {
|
|
1572
|
-
title: t('vehicleProps:title.wltpEnergyCosts'),
|
|
1573
|
-
get value() {
|
|
1574
|
-
const { fuel } = car.consumption;
|
|
1575
|
-
const { wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined } = car.consumption;
|
|
1576
|
-
const { powerPrice, fuelPrice } = car.costModel;
|
|
1577
|
-
const powerCost = {
|
|
1578
|
-
fuelPrice,
|
|
1579
|
-
powerPrice
|
|
1580
|
-
}
|
|
1581
|
-
const { hybridPlugin } = car.engineData;
|
|
1582
|
-
const consumption = {
|
|
1583
|
-
wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined
|
|
1584
|
-
}
|
|
1585
|
-
const { getFuelPrice } = financingUtils;
|
|
1586
|
-
const fuelCost = getFuelPrice(fuel, consumption, hybridPlugin, powerCost);
|
|
1587
|
-
return Number.isFinite(fuelCost)
|
|
1588
|
-
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(fuelCost, '$,.2f') })
|
|
1589
|
-
: t('vehicleProps:value.na');
|
|
1590
|
-
}
|
|
1591
|
-
},
|
|
1592
|
-
wltpCo2CostsLow: {
|
|
1593
|
-
get title() {
|
|
1594
|
-
const { co2DefaultCostsLow } = financingUtils;
|
|
1595
|
-
return t('vehicleProps:title.wltpCo2LowPrice', { price: co2DefaultCostsLow })
|
|
1596
|
-
},
|
|
1597
|
-
get value() {
|
|
1598
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1599
|
-
|
|
1600
|
-
const { getCo2Price } = financingUtils;
|
|
1601
|
-
const { co2PriceLow } = getCo2Price(wltpCo2);
|
|
1602
|
-
return Number.isFinite(co2PriceLow)
|
|
1603
|
-
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceLow, '$,.2f') })
|
|
1604
|
-
: t('vehicleProps:value.na');
|
|
1605
|
-
},
|
|
1606
|
-
get valueDescription() {
|
|
1607
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1608
|
-
|
|
1609
|
-
const { getCo2Price } = financingUtils;
|
|
1610
|
-
const { co2PriceLow } = getCo2Price(wltpCo2);
|
|
1611
|
-
return Number.isFinite(co2PriceLow) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1612
|
-
}
|
|
1613
|
-
},
|
|
1614
|
-
wltpCo2CostsMiddle: {
|
|
1615
|
-
get title() {
|
|
1616
|
-
const { co2DefaultCostsMedium } = financingUtils;
|
|
1617
|
-
return t('vehicleProps:title.wltpCo2MidPrice', { price: co2DefaultCostsMedium })
|
|
1618
|
-
},
|
|
1619
|
-
get value() {
|
|
1620
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1621
|
-
|
|
1622
|
-
const { getCo2Price } = financingUtils;
|
|
1623
|
-
const { co2PriceMedium } = getCo2Price(wltpCo2);
|
|
1624
|
-
return Number.isFinite(co2PriceMedium)
|
|
1625
|
-
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceMedium, '$,.2f') })
|
|
1626
|
-
: t('vehicleProps:value.na');
|
|
1627
|
-
},
|
|
1628
|
-
get valueDescription() {
|
|
1629
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1630
|
-
|
|
1631
|
-
const { getCo2Price } = financingUtils;
|
|
1632
|
-
const { co2PriceMedium } = getCo2Price(wltpCo2);
|
|
1633
|
-
return Number.isFinite(co2PriceMedium) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1634
|
-
}
|
|
1635
|
-
},
|
|
1636
|
-
wltpCo2CostsHigh: {
|
|
1637
|
-
get title() {
|
|
1638
|
-
const { co2DefaultCostsHigh } = financingUtils;
|
|
1639
|
-
return t('vehicleProps:title.wltpCo2HighPrice', { price: co2DefaultCostsHigh })
|
|
1640
|
-
},
|
|
1641
|
-
get value() {
|
|
1642
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1643
|
-
|
|
1644
|
-
const { getCo2Price } = financingUtils;
|
|
1645
|
-
const { co2PriceHigh } = getCo2Price(wltpCo2);
|
|
1646
|
-
return Number.isFinite(co2PriceHigh)
|
|
1647
|
-
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceHigh, '$,.2f') })
|
|
1648
|
-
: t('vehicleProps:value.na');
|
|
1649
|
-
},
|
|
1650
|
-
get valueDescription() {
|
|
1651
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1652
|
-
|
|
1653
|
-
const { getCo2Price } = financingUtils;
|
|
1654
|
-
const { co2PriceHigh } = getCo2Price(wltpCo2);
|
|
1655
|
-
return Number.isFinite(co2PriceHigh) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1656
|
-
}
|
|
1657
|
-
},
|
|
1658
|
-
powerPrice: {
|
|
1659
|
-
title: t('vehicleProps:title.powerPrice'),
|
|
1660
|
-
get value() {
|
|
1661
|
-
const fuel = car.consumption.fuel;
|
|
1662
|
-
const { hybridPlugin } = car.engineData;
|
|
1663
|
-
|
|
1664
|
-
const { getBaseFuelPrice } = financingUtils;
|
|
1665
|
-
|
|
1666
|
-
const basePowerPrice = getBaseFuelPrice(fuel, hybridPlugin).powerPrice;
|
|
1667
|
-
const powerPrice = car.costModel.powerPrice ? car.costModel.powerPrice : basePowerPrice;
|
|
1668
|
-
|
|
1669
|
-
return Number.isFinite(powerPrice)
|
|
1670
|
-
? t('vehicleProps:value.powerPrice', { price: getFormattedPrice(powerPrice, '$,.2f') })
|
|
1671
|
-
: t('vehicleProps:value.na');
|
|
1672
|
-
}
|
|
1673
|
-
},
|
|
1674
|
-
fuelPrice: {
|
|
1675
|
-
title: t('vehicleProps:title.fuelPrice'),
|
|
1676
|
-
get value() {
|
|
1677
|
-
const fuel = car.consumption.fuel;
|
|
1678
|
-
const { hybridPlugin } = car.engineData;
|
|
1679
|
-
|
|
1680
|
-
const { getBaseFuelPrice } = financingUtils;
|
|
1681
|
-
|
|
1682
|
-
const baseFuelPrice = getBaseFuelPrice(fuel, hybridPlugin) ? getBaseFuelPrice(fuel, hybridPlugin).fuelPrice : null;
|
|
1683
|
-
|
|
1684
|
-
const fuelPrice = car.costModel.fuelPrice ? car.costModel.fuelPrice : baseFuelPrice;
|
|
1685
|
-
return Number.isFinite(fuelPrice)
|
|
1686
|
-
? t('vehicleProps:value.fuelPrice', { price: getFormattedPrice(fuelPrice, '$,.2f') })
|
|
1687
|
-
: t('vehicleProps:value.na');
|
|
1688
|
-
}
|
|
1689
|
-
},
|
|
1690
|
-
consumptionPriceYear: {
|
|
1691
|
-
title: t('vehicleProps:title.consumptionPriceYear'),
|
|
1692
|
-
get value() {
|
|
1693
|
-
const { consumptionPriceYear } = car.costModel;
|
|
1694
|
-
return Number.isFinite(consumptionPriceYear)
|
|
1695
|
-
? consumptionPriceYear
|
|
1696
|
-
: t('vehicleProps:value.na');
|
|
1697
|
-
}
|
|
1698
|
-
},
|
|
1699
|
-
wltpCostModelTax: {
|
|
1700
|
-
title: t('vehicleProps:title.wltpVehicleTax'),
|
|
1701
|
-
get value() {
|
|
1702
|
-
const cubicCapacity = car.engineData.cubicCapacity;
|
|
1703
|
-
const fuel = car.consumption.fuel;
|
|
1704
|
-
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1705
|
-
const { getVehicleTax } = financingUtils;
|
|
1706
|
-
const tax = car.costModel.tax ? car.costModel.tax : getVehicleTax(fuel, cubicCapacity, wltpCo2, firstRegistration);
|
|
1707
|
-
return Number.isFinite(tax)
|
|
1708
|
-
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(tax, '$,.2f') })
|
|
1709
|
-
: t('vehicleProps:value.na');
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
};
|
|
1714
|
-
return props;
|
|
1715
|
-
};
|
|
1716
|
-
|
|
1717
|
-
export default getDecoratedProps;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
|
|
4
|
+
import Icon from '../../components/_common/IconContainer/IconContainer';
|
|
5
|
+
import CO2Efficiency from '../../components/_common/Co2Widget/CO2Efficiency';
|
|
6
|
+
import { formatTimestamp } from '../utils/DateUtils';
|
|
7
|
+
import { formatMileage } from '../utils/CommonUtils';
|
|
8
|
+
import { EMISSION_STICKERS_ICONS, WP_EMISSION_STICKERS_ICONS } from '../constants/Search';
|
|
9
|
+
import { DELIVERY_PERIODS_EXTRA } from '../constants';
|
|
10
|
+
import { IDecoratedProp, ICar, IFinancingUtils } from '../types/types';
|
|
11
|
+
import { getFormattedPrice } from '../utils/CommonUtils';
|
|
12
|
+
|
|
13
|
+
const formatDeliveryPeriod = (t: (key: string, options?: object) => string, deliveryPeriod: string) => {
|
|
14
|
+
const count: number = +DELIVERY_PERIODS_EXTRA.find((period: any) => period.value === deliveryPeriod).label;
|
|
15
|
+
// months until delivery date unrounded (float)
|
|
16
|
+
const monthsTo: number = moment.utc().diff(moment.utc().subtract(count, 'd'), 'M', true);
|
|
17
|
+
return Math.round(monthsTo) > 1
|
|
18
|
+
? t('vehicleProps:value.deliveryPeriodMonths', { count: Math.round(monthsTo) })
|
|
19
|
+
: t('vehicleProps:value.deliveryPeriodDays', { count });
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const isPropDefined = (prop: any) => {
|
|
23
|
+
const type = typeof prop;
|
|
24
|
+
if (type === 'string') {
|
|
25
|
+
return prop.indexOf('other') === -1
|
|
26
|
+
&& prop.indexOf('unknown') === -1;
|
|
27
|
+
}
|
|
28
|
+
return !(prop === undefined || prop === null) && type !== 'undefined';
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const isCheckedBatteryTime = (prop: any, t: (key: string, options?: object) => string) => {
|
|
32
|
+
switch (prop) {
|
|
33
|
+
case 'selector_batteryCharchingDurationMinutes':
|
|
34
|
+
return 'min';
|
|
35
|
+
break;
|
|
36
|
+
case 'selector_batteryCharchingDurationHours':
|
|
37
|
+
return 'h';
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
return t('vehicleProps:value.na');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const getPowerLabel = (powerKW: number, powerPS: number): string => {
|
|
45
|
+
const powerKWlabel = !!powerKW ? `${powerKW} kW ` : '';
|
|
46
|
+
const powerPSlabel = !!powerPS ? `${!!powerKW ? '(' : ''}${powerPS} PS${!!powerKW ? ')' : ''}` : '';
|
|
47
|
+
const powerKWpowerPS = `${powerKWlabel}${powerPSlabel}`;
|
|
48
|
+
|
|
49
|
+
return powerKWpowerPS;
|
|
50
|
+
};
|
|
51
|
+
const wrapValue = (value:string): React.ReactNode => {
|
|
52
|
+
const regex = /-?\d+(\,\d+)?/; // match any digit
|
|
53
|
+
const matches = value.match(regex); // get an array of all digits found
|
|
54
|
+
|
|
55
|
+
if (matches && matches.length > 0) { // If at least one number is found in the input string
|
|
56
|
+
const index = value.indexOf(matches[0]) + matches[0].length;
|
|
57
|
+
const beforeText = value.slice(0, index);
|
|
58
|
+
const afterText = value.slice(index);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
{beforeText}
|
|
63
|
+
<span className='smallText'>{afterText}</span>
|
|
64
|
+
</>
|
|
65
|
+
); // Return a JSX element with a span wrapper around the text after the number
|
|
66
|
+
}
|
|
67
|
+
return <>{value}</>; // If no numbers are found in the input string, return the original string without any modification
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const getDecoratedProps = (
|
|
71
|
+
car: ICar, // @TODO should have a proper interface
|
|
72
|
+
t: (key: string, options?: object) => string,
|
|
73
|
+
language: string = 'en',
|
|
74
|
+
simplifiedLabels: boolean = false, // shortened labels for repsonsive layout (see 'power'),
|
|
75
|
+
financingUtils?: IFinancingUtils
|
|
76
|
+
): IDecoratedProp => {
|
|
77
|
+
const {
|
|
78
|
+
offer = {},
|
|
79
|
+
// countryName,
|
|
80
|
+
mainData: {
|
|
81
|
+
firstRegistration = '',
|
|
82
|
+
mileage = '',
|
|
83
|
+
numberOfPreviousOwners = '',
|
|
84
|
+
doors = '',
|
|
85
|
+
usageType = '',
|
|
86
|
+
countryVersion = '',
|
|
87
|
+
condition = '',
|
|
88
|
+
damaged = '',
|
|
89
|
+
category = '',
|
|
90
|
+
seats = '',
|
|
91
|
+
nonSmokerVehicle = '',
|
|
92
|
+
make = '',
|
|
93
|
+
model = ''
|
|
94
|
+
} = {}
|
|
95
|
+
} = car;
|
|
96
|
+
const props: any = {
|
|
97
|
+
makeModel: {
|
|
98
|
+
title: t('vehicleProps:title.makeModel'),
|
|
99
|
+
get value() { return `${make} ${model}`; }
|
|
100
|
+
},
|
|
101
|
+
mileage: {
|
|
102
|
+
title: t('vehicleProps:title.mileage'),
|
|
103
|
+
icon: 'speed',
|
|
104
|
+
get value() {
|
|
105
|
+
return Number.isFinite(parseInt(mileage, 10))
|
|
106
|
+
? t('vehicleProps:value.mileage', { mileage: formatMileage(mileage) })
|
|
107
|
+
: t('vehicleProps:value.na');
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
firstRegistration: {
|
|
112
|
+
title: t('vehicleProps:title.firstRegistration'),
|
|
113
|
+
icon: 'date',
|
|
114
|
+
get value() {
|
|
115
|
+
return Number.isFinite(firstRegistration)
|
|
116
|
+
? formatTimestamp({ timestamp: firstRegistration, format: 'MM/YYYY' })
|
|
117
|
+
: t('vehicleProps:value.na');
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
numberOfPreviousOwners: {
|
|
122
|
+
title: t('vehicleProps:title.numberOfPreviousOwners'),
|
|
123
|
+
icon: 'owner',
|
|
124
|
+
get value() {
|
|
125
|
+
return Number.isFinite(numberOfPreviousOwners)
|
|
126
|
+
? t('vehicleProps:value.vehicleOwners', { count: numberOfPreviousOwners })
|
|
127
|
+
: t('vehicleProps:value.na');
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
doorsOnly: {
|
|
132
|
+
icon: 'door',
|
|
133
|
+
get value() {
|
|
134
|
+
if (doors > 0) {
|
|
135
|
+
return t('vehicleProps:value.doorsOnly', { doors });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return t('vehicleProps:value.na');
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
usageType: {
|
|
143
|
+
icon: 'new',
|
|
144
|
+
get value() {
|
|
145
|
+
if (condition === 'selector_condition_new') return t('vehicleProps:value.newCar');
|
|
146
|
+
return isPropDefined(usageType) ? t(`cbd:${usageType}`) : t('cbd:selector_condition_used');
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
gearbox: {
|
|
151
|
+
get icon() {
|
|
152
|
+
const gearbox = car.driveSuspension.gearbox;
|
|
153
|
+
return isPropDefined(gearbox) ? car.driveSuspension.gearbox : 'selector_gearbox_manualShift';
|
|
154
|
+
},
|
|
155
|
+
get value() {
|
|
156
|
+
const gearbox = car.driveSuspension.gearbox;
|
|
157
|
+
return isPropDefined(gearbox) ? t(`cbd:${gearbox}`) : t('vehicleProps:value.na');
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
power: {
|
|
162
|
+
title: t('vehicleProps:title.power'),
|
|
163
|
+
icon: 'ps',
|
|
164
|
+
get value() {
|
|
165
|
+
const { powerKW, powerPS } = car.engineData;
|
|
166
|
+
|
|
167
|
+
if (Number.isFinite(powerKW) && Number.isFinite(powerPS)) {
|
|
168
|
+
return simplifiedLabels
|
|
169
|
+
? t('vehicleProps:value.powerPS', { powerPS })
|
|
170
|
+
: t('vehicleProps:value.power', { powerKW, powerPS });
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return t('vehicleProps:value.na');
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
powerAlternateView: {
|
|
178
|
+
title: t('vehicleProps:title.power'),
|
|
179
|
+
icon: 'kw',
|
|
180
|
+
get value() {
|
|
181
|
+
const { powerKW, powerPS } = car.engineData;
|
|
182
|
+
return Number.isFinite(powerKW) && Number.isFinite(powerPS)
|
|
183
|
+
? t('vehicleProps:value.powerAlternateView', { powerKW, powerPS })
|
|
184
|
+
: t('vehicleProps:value.na');
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
fuel: {
|
|
189
|
+
title: t('vehicleProps:title.fuel'),
|
|
190
|
+
get icon() { return car.consumption.fuel; },
|
|
191
|
+
get value() {
|
|
192
|
+
const fuel = car.consumption.fuel;
|
|
193
|
+
return isPropDefined(fuel) ? t(`cbd:${fuel}`) : t('vehicleProps:value.na');
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
accidentDamaged: {
|
|
198
|
+
title: t('cbd:mainData_accidentDamaged'),
|
|
199
|
+
icon: 'wrench',
|
|
200
|
+
get value() {
|
|
201
|
+
return damaged ? t('vehicleProps:value.damaged') : t('vehicleProps:value.accidentFree');
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
co2: {
|
|
206
|
+
icon: 'co2',
|
|
207
|
+
get value() {
|
|
208
|
+
const co2 = car.environmentEmissions.co2;
|
|
209
|
+
return Number.isFinite(co2)
|
|
210
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
211
|
+
: t('vehicleProps:value.na');
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
|
|
215
|
+
cylinders: {
|
|
216
|
+
title: t('vehicleProps:title.cylinders'),
|
|
217
|
+
get value() {
|
|
218
|
+
const { engineLocation } = car.engineData;
|
|
219
|
+
const cylinders = parseInt(car.engineData.cylinders, 10);
|
|
220
|
+
return Number.isFinite(cylinders)
|
|
221
|
+
? (engineLocation ? `${cylinders} / ${t(`cbd:${engineLocation}`)}` : cylinders)
|
|
222
|
+
: t('vehicleProps:value.na');
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
plugIn: {
|
|
227
|
+
title: 'Plug-In',
|
|
228
|
+
get value() {
|
|
229
|
+
const { hybridPlugin } = car.engineData;
|
|
230
|
+
return hybridPlugin ? t(`cbd:selector_hybridPlugin_yes`) : t('cbd:selector_hybridPlugin_no');
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
cubicCapacity: {
|
|
235
|
+
title: t('vehicleProps:title.cubicCapacity'),
|
|
236
|
+
get value() {
|
|
237
|
+
const cubicCapacity = car.engineData.cubicCapacity;
|
|
238
|
+
return Number.isFinite(cubicCapacity)
|
|
239
|
+
? t('vehicleProps:value.cubicCapacity', { cubicCapacity: cubicCapacity.toLocaleString(language) })
|
|
240
|
+
: t('vehicleProps:value.na');
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
torque: {
|
|
245
|
+
title: t('vehicleProps:title.torque'),
|
|
246
|
+
get value() {
|
|
247
|
+
const torque = car.engineData.torque;
|
|
248
|
+
return torque
|
|
249
|
+
? t('vehicleProps:value.torque', { torque })
|
|
250
|
+
: t('vehicleProps:value.na');
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
acceleration: {
|
|
255
|
+
title: t('vehicleProps:title.acceleration'),
|
|
256
|
+
get value() {
|
|
257
|
+
const acceleration = car.engineData.acceleration100;
|
|
258
|
+
return isPropDefined(acceleration)
|
|
259
|
+
? (t('vehicleProps:value.acceleration', { seconds: acceleration }))
|
|
260
|
+
: t('vehicleProps:value.na');
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
topSpeed: {
|
|
265
|
+
title: t('vehicleProps:title.topSpeed'),
|
|
266
|
+
get value() {
|
|
267
|
+
const topSpeed = car.engineData.highSpeed;
|
|
268
|
+
return isPropDefined(topSpeed)
|
|
269
|
+
? (t('vehicleProps:value.topSpeed', { mileage: topSpeed }))
|
|
270
|
+
: t('vehicleProps:value.na');
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
transmission: {
|
|
275
|
+
title: t('vehicleProps:title.transmission'),
|
|
276
|
+
get value() {
|
|
277
|
+
const gearbox = car.driveSuspension.gearbox;
|
|
278
|
+
return isPropDefined(gearbox) ? t(`cbd:${gearbox}`) : t('vehicleProps:value.na');
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
driveType: {
|
|
283
|
+
title: t('vehicleProps:title.driveType'),
|
|
284
|
+
get icon() {
|
|
285
|
+
const driveType = car.driveSuspension.driveType;
|
|
286
|
+
return isPropDefined(driveType) ? car.driveSuspension.driveType : 'selector_driveType_frontWheelDrive';
|
|
287
|
+
},
|
|
288
|
+
get value() {
|
|
289
|
+
const driveType = car.driveSuspension.driveType;
|
|
290
|
+
return isPropDefined(driveType) ? t(`cbd:${driveType}`) : t('vehicleProps:value.na');
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
fuelCapacity: {
|
|
295
|
+
title: t('vehicleProps:title.fuelCapacity'),
|
|
296
|
+
get value() {
|
|
297
|
+
const fuelCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.fuelCapacity;
|
|
298
|
+
return Number.isFinite(fuelCapacity)
|
|
299
|
+
? t('vehicleProps:value.fuelCapacity', { capacity: fuelCapacity.toLocaleString(language) })
|
|
300
|
+
: t('vehicleProps:value.na');
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
batteryCapacity: {
|
|
305
|
+
title: t('vehicleProps:title.batteryCapacityTitle'),
|
|
306
|
+
get value() {
|
|
307
|
+
const batteryCapacity = car.battery && car.battery.batteryCapacity;
|
|
308
|
+
return batteryCapacity && Number.isFinite(batteryCapacity)
|
|
309
|
+
? t('vehicleProps:value.batteryCapacity', { batteryCapacity: batteryCapacity.toLocaleString(language) })
|
|
310
|
+
: t('vehicleProps:value.na');
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
chargingDuration230V: {
|
|
315
|
+
title: t('vehicleProps:title.chargingDuration230V'),
|
|
316
|
+
get value() {
|
|
317
|
+
const batteryChargingDuration230VSelect = car.battery && car.battery.batteryChargingDuration230VSelect;
|
|
318
|
+
const batteryChargingDuration230VHour = car.battery && car.battery.batteryChargingDuration230VHour;
|
|
319
|
+
const batteryCharchingDuration230VMinutesHours = car.battery && car.battery.batteryCharchingDuration230VMinutesHours;
|
|
320
|
+
|
|
321
|
+
return batteryChargingDuration230VSelect
|
|
322
|
+
? `${batteryChargingDuration230VHour ? `${batteryChargingDuration230VHour} ${isCheckedBatteryTime(batteryCharchingDuration230VMinutesHours, t)}` : ''} ${batteryChargingDuration230VSelect}`
|
|
323
|
+
: t('vehicleProps:value.na');
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
chargingDurationMaxSpeed: {
|
|
327
|
+
title: t('vehicleProps:title.chargingDurationMaxSpeed'),
|
|
328
|
+
get value() {
|
|
329
|
+
const batteryChargingDurationMaxSelect = car.battery && car.battery.batteryChargingDurationMaxSelect;
|
|
330
|
+
const batteryChargingDurationMaxHour = car.battery && car.battery.batteryChargingDurationMaxHour;
|
|
331
|
+
const batteryCharchingDurationMaxSelectMinutesHours = car.battery && car.battery.batteryCharchingDurationMaxSelectMinutesHours;
|
|
332
|
+
|
|
333
|
+
return batteryChargingDurationMaxSelect
|
|
334
|
+
? `${batteryChargingDurationMaxHour ? `${batteryChargingDurationMaxHour} ${isCheckedBatteryTime(batteryCharchingDurationMaxSelectMinutesHours, t)}` : ''} ${batteryChargingDurationMaxSelect}`
|
|
335
|
+
: t('vehicleProps:value.na');
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
batteryChargerType: {
|
|
339
|
+
title: t('vehicleProps:title.batteryChargerType'),
|
|
340
|
+
get value() {
|
|
341
|
+
const batteryChargerType = car.battery && car.battery.batteryChargerType;
|
|
342
|
+
|
|
343
|
+
return isPropDefined(batteryChargerType)
|
|
344
|
+
? batteryChargerType.map((item: any) => t(`cbd:${item}`)).join('\n')
|
|
345
|
+
: t('vehicleProps:value.na');
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
hsn: {
|
|
349
|
+
title: 'HSN',
|
|
350
|
+
get value() {
|
|
351
|
+
const hsn = car.metaData.hsn;
|
|
352
|
+
return isPropDefined(hsn) ? hsn : t('vehicleProps:value.na');
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
tsn: {
|
|
357
|
+
title: 'TSN',
|
|
358
|
+
get value() {
|
|
359
|
+
const tsn = car.metaData.tsn;
|
|
360
|
+
return isPropDefined(tsn) ? tsn : t('vehicleProps:value.na');
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
category: {
|
|
365
|
+
title: t('vehicleProps:title.category'),
|
|
366
|
+
get value() {
|
|
367
|
+
return isPropDefined(category) ? t(`cbd:${category}`) : t('vehicleProps:value.na');
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
length: {
|
|
372
|
+
title: t('vehicleProps:title.length'),
|
|
373
|
+
get value() {
|
|
374
|
+
const length = car.sizeVolumeWeight && car.sizeVolumeWeight.length;
|
|
375
|
+
return Number.isFinite(length)
|
|
376
|
+
? t('vehicleProps:value.length', { size: length.toLocaleString(language) })
|
|
377
|
+
: t('vehicleProps:value.na');
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
width: {
|
|
382
|
+
title: t('vehicleProps:title.width'),
|
|
383
|
+
get value() {
|
|
384
|
+
const width = car.sizeVolumeWeight && car.sizeVolumeWeight.width;
|
|
385
|
+
return Number.isFinite(width)
|
|
386
|
+
? t('vehicleProps:value.width', { size: width.toLocaleString(language) })
|
|
387
|
+
: t('vehicleProps:value.na');
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
height: {
|
|
392
|
+
title: t('vehicleProps:title.height'),
|
|
393
|
+
get value() {
|
|
394
|
+
const height = car.sizeVolumeWeight && car.sizeVolumeWeight.height;
|
|
395
|
+
return Number.isFinite(height)
|
|
396
|
+
? t('vehicleProps:value.height', { size: height.toLocaleString(language) })
|
|
397
|
+
: t('vehicleProps:value.na');
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
|
|
401
|
+
base: {
|
|
402
|
+
title: t('vehicleProps:title.base'),
|
|
403
|
+
get value() {
|
|
404
|
+
const wheelBase = car.driveSuspension.wheelBase;
|
|
405
|
+
return Number.isFinite(wheelBase)
|
|
406
|
+
? t('vehicleProps:value.base', { size: wheelBase.toLocaleString(language) })
|
|
407
|
+
: t('vehicleProps:value.na');
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
|
|
411
|
+
capacityLoad: {
|
|
412
|
+
title: t('vehicleProps:title.loadingVolume'),
|
|
413
|
+
get value() {
|
|
414
|
+
const completeCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.completeCapacity;
|
|
415
|
+
return Number.isFinite(completeCapacity)
|
|
416
|
+
? t('vehicleProps:value.capacityLoad', { capacity: completeCapacity.toLocaleString(language) })
|
|
417
|
+
: t('vehicleProps:value.na');
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
bootCapacity: {
|
|
422
|
+
title: t('vehicleProps:title.bootCapacity'),
|
|
423
|
+
get value() {
|
|
424
|
+
const cargoCapacity = car.sizeVolumeWeight && car.sizeVolumeWeight.cargoCapacity;
|
|
425
|
+
return Number.isFinite(cargoCapacity)
|
|
426
|
+
? t('vehicleProps:value.bootCapacity', { capacity: cargoCapacity.toLocaleString(language) })
|
|
427
|
+
: t('vehicleProps:value.na');
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
|
|
431
|
+
doors: {
|
|
432
|
+
title: t('vehicleProps:title.doors'),
|
|
433
|
+
get value() { return doors > 0 ? doors : t('vehicleProps:value.na'); }
|
|
434
|
+
},
|
|
435
|
+
|
|
436
|
+
seats: {
|
|
437
|
+
title: t('vehicleProps:title.seats'),
|
|
438
|
+
get value() { return seats > 0 ? seats : t('vehicleProps:value.na'); }
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
tare: {
|
|
442
|
+
title: t('vehicleProps:title.tare'),
|
|
443
|
+
get value() {
|
|
444
|
+
const emptyWeight = car.sizeVolumeWeight && car.sizeVolumeWeight.emptyWeight;
|
|
445
|
+
return Number.isFinite(emptyWeight)
|
|
446
|
+
? t('vehicleProps:value.tareWeight', { weight: (emptyWeight).toLocaleString(language) })
|
|
447
|
+
: t('vehicleProps:value.na');
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
maximumWeight: {
|
|
452
|
+
title: t('vehicleProps:title.maximumWeight'),
|
|
453
|
+
get value() {
|
|
454
|
+
const maxWeight = car.sizeVolumeWeight && car.sizeVolumeWeight.maxWeight;
|
|
455
|
+
return Number.isFinite(maxWeight)
|
|
456
|
+
? t('vehicleProps:value.maximumWeightCapacity', { capacity: maxWeight.toLocaleString(language) })
|
|
457
|
+
: t('vehicleProps:value.na');
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
trailerWeightBraked: {
|
|
462
|
+
title: t('vehicleProps:title.trailerLoadBraked'),
|
|
463
|
+
get value() {
|
|
464
|
+
const trailerWeightBraked = car.sizeVolumeWeight && car.sizeVolumeWeight.trailerWeightBraked;
|
|
465
|
+
return Number.isFinite(trailerWeightBraked)
|
|
466
|
+
? t('vehicleProps:value.weight', { weight: trailerWeightBraked.toLocaleString(language) })
|
|
467
|
+
: t('vehicleProps:value.na');
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
|
|
471
|
+
trailerWeightUnbraked: {
|
|
472
|
+
title: t('vehicleProps:title.trailerLoadUnbraked'),
|
|
473
|
+
get value() {
|
|
474
|
+
const trailerWeightUnbraked = car.sizeVolumeWeight && car.sizeVolumeWeight.trailerWeightUnbraked;
|
|
475
|
+
return Number.isFinite(trailerWeightUnbraked)
|
|
476
|
+
? t('vehicleProps:value.weight', { weight: trailerWeightUnbraked.toLocaleString(language) })
|
|
477
|
+
: t('vehicleProps:value.na');
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
|
|
481
|
+
consumptionInner: {
|
|
482
|
+
icon: 'fuelConsumption',
|
|
483
|
+
title: t('vehicleProps:title.consumptionInner'),
|
|
484
|
+
get value() {
|
|
485
|
+
const consumptionInner = car.consumption.consumptionInner;
|
|
486
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
487
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
488
|
+
return Number.isFinite(consumptionInner)
|
|
489
|
+
? t('vehicleProps:value.consumption', { consumption: consumptionInner.toLocaleString(language), unit: translatedUnit })
|
|
490
|
+
: t('vehicleProps:value.na');
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
|
|
494
|
+
consumptionPowerInner: {
|
|
495
|
+
icon: 'fuelConsumption',
|
|
496
|
+
title: t('vehicleProps:title.consumptionPowerInner'),
|
|
497
|
+
get value() {
|
|
498
|
+
const consumptionPowerInner = car.consumption.consumptionInner;
|
|
499
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
500
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
501
|
+
return Number.isFinite(consumptionPowerInner)
|
|
502
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerInner.toLocaleString(language), unit: translatedUnit })
|
|
503
|
+
: t('vehicleProps:value.na');
|
|
504
|
+
}
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
consumptionPowerHybridInner: {
|
|
508
|
+
icon: 'fuelConsumption',
|
|
509
|
+
title: t('vehicleProps:title.consumptionPowerInner'),
|
|
510
|
+
get value() {
|
|
511
|
+
const consumptionPowerInner = car.consumption.consumptionPowerInner;
|
|
512
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
513
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
514
|
+
return Number.isFinite(consumptionPowerInner)
|
|
515
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerInner.toLocaleString(language), unit: translatedUnit })
|
|
516
|
+
: t('vehicleProps:value.na');
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
|
|
520
|
+
consumptionHydrogenInner: {
|
|
521
|
+
icon: 'fuelConsumption',
|
|
522
|
+
title: t('vehicleProps:title.consumptionHydrogenInner'),
|
|
523
|
+
get value() {
|
|
524
|
+
const consumptionHydrogenInner = car.consumption.consumptionInner;
|
|
525
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
526
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
527
|
+
return Number.isFinite(consumptionHydrogenInner)
|
|
528
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenInner.toLocaleString(language), unit: translatedUnit })
|
|
529
|
+
: t('vehicleProps:value.na');
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
consumptionGasInner: {
|
|
533
|
+
icon: 'fuelConsumption',
|
|
534
|
+
title: t('vehicleProps:title.consumptionGasInner'),
|
|
535
|
+
get value() {
|
|
536
|
+
const consumptionGasInner = car.consumption.consumptionInner;
|
|
537
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
538
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
539
|
+
return Number.isFinite(consumptionGasInner)
|
|
540
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasInner.toLocaleString(language), unit: translatedUnit })
|
|
541
|
+
: t('vehicleProps:value.na');
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
|
|
545
|
+
consumptionOuter: {
|
|
546
|
+
icon: 'fuelConsumption',
|
|
547
|
+
title: t('vehicleProps:title.consumptionOuter'),
|
|
548
|
+
get value() {
|
|
549
|
+
const consumptionOuter = car.consumption.consumptionOuter;
|
|
550
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
551
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
552
|
+
return Number.isFinite(consumptionOuter)
|
|
553
|
+
? t('vehicleProps:value.consumption', { consumption: consumptionOuter.toLocaleString(language), unit: translatedUnit })
|
|
554
|
+
: t('vehicleProps:value.na');
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
|
|
558
|
+
consumptionPowerOuter: {
|
|
559
|
+
icon: 'fuelConsumption',
|
|
560
|
+
title: t('vehicleProps:title.consumptionPowerOuter'),
|
|
561
|
+
get value() {
|
|
562
|
+
const consumptionPowerOuter = car.consumption.consumptionOuter;
|
|
563
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
564
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
565
|
+
return Number.isFinite(consumptionPowerOuter)
|
|
566
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerOuter.toLocaleString(language), unit: translatedUnit })
|
|
567
|
+
: t('vehicleProps:value.na');
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
|
|
571
|
+
consumptionPowerHybridOuter: {
|
|
572
|
+
icon: 'fuelConsumption',
|
|
573
|
+
title: t('vehicleProps:title.consumptionPowerOuter'),
|
|
574
|
+
get value() {
|
|
575
|
+
const consumptionPowerOuter = car.consumption.consumptionPowerOuter;
|
|
576
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
577
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
578
|
+
return Number.isFinite(consumptionPowerOuter)
|
|
579
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerOuter.toLocaleString(language), unit: translatedUnit })
|
|
580
|
+
: t('vehicleProps:value.na');
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
|
|
584
|
+
consumptionHydrogenOuter: {
|
|
585
|
+
icon: 'fuelConsumption',
|
|
586
|
+
title: t('vehicleProps:title.consumptionHydrogenOuter'),
|
|
587
|
+
get value() {
|
|
588
|
+
const consumptionHydrogenOuter = car.consumption.consumptionOuter;
|
|
589
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
590
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
591
|
+
return Number.isFinite(consumptionHydrogenOuter)
|
|
592
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenOuter.toLocaleString(language), unit: translatedUnit })
|
|
593
|
+
: t('vehicleProps:value.na');
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
|
|
597
|
+
consumptionGasOuter: {
|
|
598
|
+
icon: 'fuelConsumption',
|
|
599
|
+
title: t('vehicleProps:title.consumptionGasOuter'),
|
|
600
|
+
get value() {
|
|
601
|
+
const consumptionGasOuter = car.consumption.consumptionOuter;
|
|
602
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
603
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
604
|
+
return Number.isFinite(consumptionGasOuter)
|
|
605
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasOuter.toLocaleString(language), unit: translatedUnit })
|
|
606
|
+
: t('vehicleProps:value.na');
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
|
|
610
|
+
consumptionCombined: {
|
|
611
|
+
icon: 'fuelConsumption',
|
|
612
|
+
title: t('vehicleProps:title.сonsumptionCombined'),
|
|
613
|
+
get value() {
|
|
614
|
+
const consumptionCombined = car.consumption.consumptionCombined;
|
|
615
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
616
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
617
|
+
return Number.isFinite(consumptionCombined)
|
|
618
|
+
? t('vehicleProps:value.consumption', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
619
|
+
: t('vehicleProps:value.na');
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
|
|
623
|
+
consumptionPowerCombined: {
|
|
624
|
+
icon: 'fuelConsumption',
|
|
625
|
+
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
626
|
+
get value() {
|
|
627
|
+
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
628
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
629
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
630
|
+
return Number.isFinite(consumptionPowerCombined)
|
|
631
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
632
|
+
: t('vehicleProps:value.na');
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
consumptionPowerHybridCombined: {
|
|
637
|
+
icon: 'fuelConsumption',
|
|
638
|
+
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
639
|
+
get value() {
|
|
640
|
+
const consumptionPowerCombined = car.consumption.consumptionPowerCombined;
|
|
641
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
642
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
643
|
+
return Number.isFinite(consumptionPowerCombined)
|
|
644
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
645
|
+
: t('vehicleProps:value.na');
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
|
|
649
|
+
consumptionHydrogenCombined: {
|
|
650
|
+
icon: 'fuelConsumption',
|
|
651
|
+
title: t('vehicleProps:title.consumptionHydrogenCombined'),
|
|
652
|
+
get value() {
|
|
653
|
+
const consumptionHydrogenCombined = car.consumption.consumptionCombined;
|
|
654
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
655
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
656
|
+
return Number.isFinite(consumptionHydrogenCombined)
|
|
657
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
658
|
+
: t('vehicleProps:value.na');
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
|
|
662
|
+
consumptionGasCombined: {
|
|
663
|
+
icon: 'fuelConsumption',
|
|
664
|
+
title: t('vehicleProps:title.consumptionGasCombined'),
|
|
665
|
+
get value() {
|
|
666
|
+
const consumptionGasCombined = car.consumption.consumptionCombined;
|
|
667
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
668
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
669
|
+
return Number.isFinite(consumptionGasCombined)
|
|
670
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
671
|
+
: t('vehicleProps:value.na');
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
|
|
675
|
+
consumptionCombinedAlternateView: {
|
|
676
|
+
icon: 'fuelConsumption',
|
|
677
|
+
get value() {
|
|
678
|
+
const consumptionCombined = car.consumption.consumptionCombined;
|
|
679
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
680
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
681
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
682
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
683
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
684
|
+
|
|
685
|
+
const co2 = car.environmentEmissions.co2;
|
|
686
|
+
|
|
687
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
688
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
689
|
+
: null;
|
|
690
|
+
|
|
691
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
692
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
693
|
+
: null;
|
|
694
|
+
|
|
695
|
+
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
696
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
697
|
+
: t('vehicleProps:value.na');
|
|
698
|
+
|
|
699
|
+
const co2Value = Number.isFinite(co2)
|
|
700
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
701
|
+
: t('vehicleProps:value.na');
|
|
702
|
+
|
|
703
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
704
|
+
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
705
|
+
: null;
|
|
706
|
+
|
|
707
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
708
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
consumptionPowerCombinedAlternateView: {
|
|
715
|
+
icon: 'fuelConsumption',
|
|
716
|
+
title: t('vehicleProps:title.consumptionPowerCombined'),
|
|
717
|
+
get value() {
|
|
718
|
+
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
719
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
720
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
721
|
+
const co2 = car.environmentEmissions.co2;
|
|
722
|
+
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
723
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
724
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
725
|
+
|
|
726
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
727
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
728
|
+
: null;
|
|
729
|
+
|
|
730
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
731
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
732
|
+
: null;
|
|
733
|
+
|
|
734
|
+
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
735
|
+
? t('vehicleProps:value.consumptionPower', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
736
|
+
: t('vehicleProps:value.na');
|
|
737
|
+
|
|
738
|
+
const co2Value = Number.isFinite(co2)
|
|
739
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
740
|
+
: t('vehicleProps:value.na');
|
|
741
|
+
|
|
742
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
743
|
+
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
744
|
+
: null;
|
|
745
|
+
|
|
746
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
747
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
consumptionHydrogenCombinedAlternateView: {
|
|
754
|
+
icon: 'fuelConsumption',
|
|
755
|
+
title: t('vehicleProps:title.consumptionHydrogenCombined'),
|
|
756
|
+
get value() {
|
|
757
|
+
const consumptionHydrogenCombined = car.consumption.consumptionCombined;
|
|
758
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
759
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
760
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
761
|
+
const co2 = car.environmentEmissions.co2;
|
|
762
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
763
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
764
|
+
|
|
765
|
+
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
766
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
767
|
+
: t('vehicleProps:value.na');
|
|
768
|
+
|
|
769
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
770
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
771
|
+
: null;
|
|
772
|
+
|
|
773
|
+
const co2Value = Number.isFinite(co2)
|
|
774
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
775
|
+
: t('vehicleProps:value.na');
|
|
776
|
+
|
|
777
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
778
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
779
|
+
: null;
|
|
780
|
+
|
|
781
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
782
|
+
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
783
|
+
: null;
|
|
784
|
+
|
|
785
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
786
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
consumptionGasCombinedAlternateView: {
|
|
793
|
+
icon: 'fuelConsumption',
|
|
794
|
+
title: t('vehicleProps:title.consumptionGasCombined'),
|
|
795
|
+
get value() {
|
|
796
|
+
const consumptionGasCombined = car.consumption.consumptionCombined;
|
|
797
|
+
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
798
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
799
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
800
|
+
|
|
801
|
+
const co2 = car.environmentEmissions.co2;
|
|
802
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
803
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
804
|
+
|
|
805
|
+
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
806
|
+
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
807
|
+
: t('vehicleProps:value.na');
|
|
808
|
+
|
|
809
|
+
const co2Value = Number.isFinite(co2)
|
|
810
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
811
|
+
: t('vehicleProps:value.na');
|
|
812
|
+
|
|
813
|
+
const wltpConsumptionValue = Number.isFinite(wltpConsumptionCombined)
|
|
814
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpConsumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
815
|
+
: null;
|
|
816
|
+
|
|
817
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
818
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
819
|
+
: null;
|
|
820
|
+
|
|
821
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
822
|
+
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
823
|
+
: null;
|
|
824
|
+
|
|
825
|
+
if (wltpConsumptionValue && wltpCo2Value) {
|
|
826
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}{co2ClassValue && <><br />{co2ClassValue}</>}</>;
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
|
|
833
|
+
consumptionCombinedHybridAlternateView: {
|
|
834
|
+
icon: 'fuelConsumption',
|
|
835
|
+
get value() {
|
|
836
|
+
const consumptionCombined = +car.consumption.consumptionCombined;
|
|
837
|
+
const consumptionPowerCombined = +car.consumption.consumptionPowerCombined;
|
|
838
|
+
// const wltpPowerCombined = car.consumption.wltpPowerCombined || car.consumption.wltpWeightedPowerCombined;
|
|
839
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
840
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
841
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
842
|
+
|
|
843
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
844
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
845
|
+
|
|
846
|
+
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
847
|
+
// const wltpConsumptionPowerCombinedContent = wltpPowerCombined
|
|
848
|
+
// ? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
849
|
+
// : null;
|
|
850
|
+
|
|
851
|
+
const wltpConsumptionWeightedPowerCombinedContent = wltpWeightedPowerCombined
|
|
852
|
+
? t('vehicleProps:value.consumptionPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
853
|
+
: null;
|
|
854
|
+
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
855
|
+
const wltpConsumptionCombinedContent = wltpCombined ?
|
|
856
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
857
|
+
: null;
|
|
858
|
+
const wltpConsumptionWeightedCombinedContent = wltpWeightedCombined ?
|
|
859
|
+
t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
860
|
+
: null;
|
|
861
|
+
|
|
862
|
+
const co2 = car.environmentEmissions.co2;
|
|
863
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
864
|
+
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
865
|
+
const co2Value = Number.isFinite(co2)
|
|
866
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
867
|
+
: t('vehicleProps:value.na');
|
|
868
|
+
const wltpCo2Value = Number.isFinite(wltpCo2)
|
|
869
|
+
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
870
|
+
: null;
|
|
871
|
+
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
872
|
+
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
873
|
+
: null;
|
|
874
|
+
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
875
|
+
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
876
|
+
: null;
|
|
877
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
878
|
+
|
|
879
|
+
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
880
|
+
return <React.Fragment>
|
|
881
|
+
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
|
|
882
|
+
{wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
|
|
883
|
+
{wrapValue(wltpCo2PluginValue)}
|
|
884
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
885
|
+
</React.Fragment>
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (wltpConsumptionCombinedContent && wltpCo2Value) {
|
|
889
|
+
return <React.Fragment>
|
|
890
|
+
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
891
|
+
{wrapValue(wltpCo2Value)}
|
|
892
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
893
|
+
</React.Fragment>
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
return Number.isFinite(consumptionCombined) && Number.isFinite(consumptionPowerCombined)
|
|
897
|
+
? <React.Fragment>
|
|
898
|
+
{consumptionPowerCombined && hybridPlugin ? wrapValue(consumptionPowerCombinedContent) : ''}
|
|
899
|
+
{consumptionPowerCombined && hybridPlugin ? <br /> : ''}
|
|
900
|
+
{wrapValue(consumptionCombinedContent)} <br />
|
|
901
|
+
{wrapValue(co2Value)}
|
|
902
|
+
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
903
|
+
</React.Fragment>
|
|
904
|
+
: t('vehicleProps:value.na');
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
|
|
908
|
+
rangeHydrogen: {
|
|
909
|
+
title: t('vehicleProps:title.rangeHydrogen'),
|
|
910
|
+
get value() {
|
|
911
|
+
const { rangeHydrogen } = car.engineData;
|
|
912
|
+
return Number.isFinite(rangeHydrogen)
|
|
913
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: rangeHydrogen.toLocaleString(language) })
|
|
914
|
+
: t('vehicleProps:value.na');
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
batteryRangeElectric: {
|
|
918
|
+
title: t('vehicleProps:title.batteryRangeElectric'),
|
|
919
|
+
get value() {
|
|
920
|
+
const batteryRangeElectric = car.battery && car.battery.batteryRangeElectric;
|
|
921
|
+
return Number.isFinite(batteryRangeElectric)
|
|
922
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: batteryRangeElectric.toLocaleString(language) })
|
|
923
|
+
: t('vehicleProps:value.na');
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
|
|
927
|
+
c02: {
|
|
928
|
+
title: t('vehicleProps:title.co2'),
|
|
929
|
+
get value() {
|
|
930
|
+
const c02 = car.environmentEmissions.co2;
|
|
931
|
+
return Number.isFinite(c02)
|
|
932
|
+
? t('vehicleProps:value.co2', { co2: c02.toLocaleString(language) })
|
|
933
|
+
: t('vehicleProps:value.na');
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
|
|
937
|
+
consumptionAndCo2: {
|
|
938
|
+
title: t('vehicleProps:title.consumptionAndCo2'),
|
|
939
|
+
get value() {
|
|
940
|
+
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
941
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
942
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
943
|
+
const co2 = car.environmentEmissions.co2;
|
|
944
|
+
const consumptionValue = Number.isFinite(consumptionPowerCombined)
|
|
945
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
946
|
+
: t('vehicleProps:value.na');
|
|
947
|
+
const co2Value = Number.isFinite(co2)
|
|
948
|
+
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
949
|
+
: t('vehicleProps:value.na');
|
|
950
|
+
|
|
951
|
+
return `${consumptionValue} | ${co2Value}`;
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
emissionClass: {
|
|
955
|
+
title: t('vehicleProps:title.emissionClass'),
|
|
956
|
+
get value() {
|
|
957
|
+
const emissionClass = car.environmentEmissions.emissionClass;
|
|
958
|
+
return isPropDefined(emissionClass) ? t(`cbd:${emissionClass}`) : t('vehicleProps:value.na');
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
|
|
962
|
+
emissionSticker: {
|
|
963
|
+
title: t('vehicleProps:title.emissionsSticker'),
|
|
964
|
+
get value() {
|
|
965
|
+
const emissionSticker = car.environmentEmissions.emissionSticker;
|
|
966
|
+
let icon = null;
|
|
967
|
+
const size = 25;
|
|
968
|
+
|
|
969
|
+
if (emissionSticker !== 'selector_emissionSticker_no') {
|
|
970
|
+
icon = EMISSION_STICKERS_ICONS[emissionSticker];
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
return icon ? <Icon src={icon} width={size} height={size} /> : t('vehicleProps:value.na');
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
|
|
977
|
+
wpEmissionSticker: {
|
|
978
|
+
title: t('vehicleProps:title.emissionsSticker'),
|
|
979
|
+
get value() {
|
|
980
|
+
const emissionSticker = car.environmentEmissions.emissionSticker;
|
|
981
|
+
let icon = null;
|
|
982
|
+
const size = 25;
|
|
983
|
+
|
|
984
|
+
if (emissionSticker !== 'selector_emissionSticker_no') {
|
|
985
|
+
icon = WP_EMISSION_STICKERS_ICONS[emissionSticker];
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return icon ? <Icon src={icon} width={size} height={size} /> : t('vehicleProps:value.na');
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
|
|
992
|
+
energyEfficiencyClass: {
|
|
993
|
+
title: t('vehicleProps:title.energyEfficiencyClass'),
|
|
994
|
+
subTitle: t('vehicleProps:title.subTitle'),
|
|
995
|
+
get value() {
|
|
996
|
+
const level = car.environmentEmissions.energyEfficiencyClass;
|
|
997
|
+
return isPropDefined(level) ? <CO2Efficiency level={level} t={t} /> : t('vehicleProps:value.na');
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
|
|
1001
|
+
offerAvailability: {
|
|
1002
|
+
title: t('vehicleProps:title.offerAvailability'),
|
|
1003
|
+
icon: 'carAvailability',
|
|
1004
|
+
get value() {
|
|
1005
|
+
const offerAvailabilityMode = offer.availabilityMode;
|
|
1006
|
+
const offerAvailabilityTimestamp = offer.availabilityFrom;
|
|
1007
|
+
const humanViewTime = moment.unix(offerAvailabilityTimestamp).format('DD.MM.YYYY');
|
|
1008
|
+
let offerAvailability: string;
|
|
1009
|
+
|
|
1010
|
+
switch (offerAvailabilityMode) {
|
|
1011
|
+
case 'selector_availabilityMode_always':
|
|
1012
|
+
offerAvailability = t(`cbd:${offerAvailabilityMode}`);
|
|
1013
|
+
break;
|
|
1014
|
+
|
|
1015
|
+
case 'selector_availabilityMode_fromDate':
|
|
1016
|
+
if (offer.deliveryPeriod != null && offer.deliveryPeriod !== 'selector_unknown') {
|
|
1017
|
+
offerAvailability = formatDeliveryPeriod(t, offer.deliveryPeriod);
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
if (moment.utc(offerAvailabilityTimestamp, 'X').isBefore()) {
|
|
1022
|
+
offerAvailability = t('cbd:selector_availabilityMode_always');
|
|
1023
|
+
} else if (!!offerAvailabilityTimestamp) {
|
|
1024
|
+
offerAvailability = t('vehicleProps:value.fromDate', { date: humanViewTime });
|
|
1025
|
+
} else {
|
|
1026
|
+
offerAvailability = t('vehicleProps:value.onRequest'); // case when "availabilityFrom" is undefined
|
|
1027
|
+
}
|
|
1028
|
+
break;
|
|
1029
|
+
|
|
1030
|
+
default:
|
|
1031
|
+
if (!offerAvailabilityMode && !firstRegistration && !mileage) offerAvailability = t('vehicleProps:value.onRequest');
|
|
1032
|
+
else offerAvailability = null;
|
|
1033
|
+
}
|
|
1034
|
+
return isPropDefined(offerAvailability) ? offerAvailability : t('vehicleProps:value.na');
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
|
|
1038
|
+
lastTechnicalService: {
|
|
1039
|
+
title: t('vehicleProps:title.lastTechnicalService'),
|
|
1040
|
+
get value() {
|
|
1041
|
+
const lastTechnicalService = car.careService.lastTechnicalService;
|
|
1042
|
+
return Number.isFinite(lastTechnicalService)
|
|
1043
|
+
? formatTimestamp({ timestamp: lastTechnicalService, format: 'MM/YYYY' })
|
|
1044
|
+
: t('vehicleProps:value.na');
|
|
1045
|
+
}
|
|
1046
|
+
},
|
|
1047
|
+
|
|
1048
|
+
generalInspection: {
|
|
1049
|
+
title: t('vehicleProps:title.generalInspection'),
|
|
1050
|
+
get value() {
|
|
1051
|
+
const generalInspection = car.careService.generalInspection;
|
|
1052
|
+
if (car.offer.newHuAu) {
|
|
1053
|
+
return t('vehicleProps:value.new');
|
|
1054
|
+
// tslint:disable-next-line:no-else-after-return
|
|
1055
|
+
}else {
|
|
1056
|
+
return Number.isFinite(generalInspection)
|
|
1057
|
+
? formatTimestamp({ timestamp: generalInspection, format: 'MM/YYYY' })
|
|
1058
|
+
: t('vehicleProps:value.na');
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
|
|
1063
|
+
condition: {
|
|
1064
|
+
title: t('vehicleProps:title.сondition'),
|
|
1065
|
+
get value() {
|
|
1066
|
+
return isPropDefined(condition)
|
|
1067
|
+
? t(`cbd:${condition}`)
|
|
1068
|
+
: t('vehicleProps:value.na');
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
|
|
1072
|
+
numberOfPreviousOwnersSimple: {
|
|
1073
|
+
title: t('vehicleProps:title.numberOfPreviousOwners'),
|
|
1074
|
+
get value() {
|
|
1075
|
+
return Number.isFinite(numberOfPreviousOwners)
|
|
1076
|
+
? numberOfPreviousOwners
|
|
1077
|
+
: t('vehicleProps:value.na');
|
|
1078
|
+
}
|
|
1079
|
+
},
|
|
1080
|
+
|
|
1081
|
+
guarantee: {
|
|
1082
|
+
title: t('vehicleProps:title.guarantee'),
|
|
1083
|
+
get value() {
|
|
1084
|
+
const guarantee = car.offer.warranty;
|
|
1085
|
+
return isPropDefined(guarantee)
|
|
1086
|
+
? (guarantee ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1087
|
+
: t('vehicleProps:value.na');
|
|
1088
|
+
}
|
|
1089
|
+
},
|
|
1090
|
+
|
|
1091
|
+
maintenanceGuide: {
|
|
1092
|
+
title: t('vehicleProps:title.maintenanceGuide'),
|
|
1093
|
+
get value() {
|
|
1094
|
+
const fullserviceHistory = car.careService.fullServiceHistory;
|
|
1095
|
+
return isPropDefined(fullserviceHistory)
|
|
1096
|
+
? (fullserviceHistory ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1097
|
+
: t('vehicleProps:value.na');
|
|
1098
|
+
}
|
|
1099
|
+
},
|
|
1100
|
+
|
|
1101
|
+
nonSmokerVehicle: {
|
|
1102
|
+
title: t('vehicleProps:title.nonSmokingVehicle'),
|
|
1103
|
+
get value() {
|
|
1104
|
+
return isPropDefined(nonSmokerVehicle)
|
|
1105
|
+
? (nonSmokerVehicle ? t('vehicleProps:value.yes') : t('vehicleProps:value.no'))
|
|
1106
|
+
: t('vehicleProps:value.na');
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
|
|
1110
|
+
manufacturerColorName: {
|
|
1111
|
+
title: t('vehicleProps:title.manufacturerColorName'),
|
|
1112
|
+
get value() {
|
|
1113
|
+
const color = car.exterior.manufacturerColorName;
|
|
1114
|
+
|
|
1115
|
+
if (typeof color !== 'string' || color === '') {
|
|
1116
|
+
return t('vehicleProps:value.na');
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
return color[0].toUpperCase() + color.slice(1);
|
|
1120
|
+
}
|
|
1121
|
+
},
|
|
1122
|
+
|
|
1123
|
+
exteriorColor: {
|
|
1124
|
+
title: t('vehicleProps:title.colour'),
|
|
1125
|
+
get value() {
|
|
1126
|
+
const exteriorColor = car.exterior.exteriorColor;
|
|
1127
|
+
return isPropDefined(exteriorColor)
|
|
1128
|
+
? t(`cbd:${exteriorColor.replace('exterior_', '')}`)
|
|
1129
|
+
: t('vehicleProps:value.na');
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
|
|
1133
|
+
appointmentsColor: {
|
|
1134
|
+
title: t('vehicleProps:title.appointmentsColor'),
|
|
1135
|
+
get value() {
|
|
1136
|
+
const interiorColor = car.interior.interiorColor;
|
|
1137
|
+
return isPropDefined(interiorColor)
|
|
1138
|
+
? t(`cbd:${interiorColor.replace('interior_', '')}`)
|
|
1139
|
+
: t('vehicleProps:value.na');
|
|
1140
|
+
}
|
|
1141
|
+
},
|
|
1142
|
+
|
|
1143
|
+
interiorType: {
|
|
1144
|
+
title: t('vehicleProps:title.interiorType'),
|
|
1145
|
+
get value() {
|
|
1146
|
+
const interiorType = car.interior.interiorType;
|
|
1147
|
+
return isPropDefined(interiorType)
|
|
1148
|
+
? t(`cbd:${interiorType}`)
|
|
1149
|
+
: t('vehicleProps:value.na');
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
signOfUse : {
|
|
1153
|
+
title: t('vehicleProps:title.signsOfUse'),
|
|
1154
|
+
isVisible: mileage > 100, // tslint:disable-line
|
|
1155
|
+
isLongTitle: true,
|
|
1156
|
+
get value() {
|
|
1157
|
+
return t('vehicleProps:value.yes');
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
countryVersion : {
|
|
1161
|
+
title: t('vehicleProps:title.countryVersion'),
|
|
1162
|
+
get value() {
|
|
1163
|
+
const countryName = car.countryActive[language];
|
|
1164
|
+
if (!countryVersion) return t('vehicleProps:value.na');
|
|
1165
|
+
switch (countryVersion) {
|
|
1166
|
+
case 'de':
|
|
1167
|
+
return t('vehicleProps:value.countryDEversion');
|
|
1168
|
+
break;
|
|
1169
|
+
case 'eu':
|
|
1170
|
+
return t('vehicleProps:value.countryEUversion');
|
|
1171
|
+
break;
|
|
1172
|
+
case 'at':
|
|
1173
|
+
return t('vehicleProps:value.countryATversion');
|
|
1174
|
+
break;
|
|
1175
|
+
default:
|
|
1176
|
+
return t('vehicleProps:value.countryVersionName', { countryName });
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
},
|
|
1180
|
+
wltpCo2: {
|
|
1181
|
+
title: t('vehicleProps:title.wltpCo2'),
|
|
1182
|
+
get value() {
|
|
1183
|
+
const c02 = car.environmentEmissions.wltpCo2;
|
|
1184
|
+
return Number.isFinite(c02)
|
|
1185
|
+
? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
|
|
1186
|
+
: t('vehicleProps:value.na');
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
wltpCo2Plugin: {
|
|
1190
|
+
title: t('vehicleProps:title.wltpCo2Plugin'),
|
|
1191
|
+
get value() {
|
|
1192
|
+
const c02 = car.environmentEmissions.wltpCo2;
|
|
1193
|
+
return Number.isFinite(c02)
|
|
1194
|
+
? t('vehicleProps:value.wltpCo2', { co2: c02.toLocaleString(language) })
|
|
1195
|
+
: t('vehicleProps:value.na');
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
wltpCo2Discharged: {
|
|
1199
|
+
title: t('vehicleProps:title.wltpCo2Discharged'),
|
|
1200
|
+
get value() {
|
|
1201
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2Discharged;
|
|
1202
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1203
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1204
|
+
return Number.isFinite(wltpCo2)
|
|
1205
|
+
? t('vehicleProps:value.wltpCo2', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
|
|
1206
|
+
: t('vehicleProps:value.na');
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
wltpEnergyEfficiencyClass: {
|
|
1210
|
+
// title: t('vehicleProps:title.wltpEnergyEfficiencyClass'),
|
|
1211
|
+
// subTitle: t('vehicleProps:title.subTitle'),
|
|
1212
|
+
get value() {
|
|
1213
|
+
const level = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
1214
|
+
const wltpLevel = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1215
|
+
const { hybridPlugin } = car.engineData;
|
|
1216
|
+
const subtitle = hybridPlugin ? t('vehicleProps:title.wltpCO2SubTitle') : t('vehicleProps:title.wltpCO2SubTitleComb');
|
|
1217
|
+
return isPropDefined(level) ?
|
|
1218
|
+
<CO2Efficiency
|
|
1219
|
+
title={t('vehicleProps:title.wltpCO2Title')}
|
|
1220
|
+
subTitle={subtitle}
|
|
1221
|
+
wltpLevel={wltpLevel}
|
|
1222
|
+
level={level}
|
|
1223
|
+
t={t}
|
|
1224
|
+
levelTitle={t('vehicleProps:title.wltpCO2WidgetComb')}
|
|
1225
|
+
wltpLevelTitle={t('vehicleProps:title.wltpCO2WidgetDischargedBattery')}
|
|
1226
|
+
hybridPlugin={hybridPlugin}
|
|
1227
|
+
isWltp
|
|
1228
|
+
/> : t('vehicleProps:value.na');
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
wltpDischargedEnergyEfficiencyClass: {
|
|
1232
|
+
title: t('vehicleProps:title.wltpDischargedEnergyEfficiencyClass'),
|
|
1233
|
+
subTitle: t('vehicleProps:title.subTitle'),
|
|
1234
|
+
get value() {
|
|
1235
|
+
const level = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass;
|
|
1236
|
+
return isPropDefined(level) ? <CO2Efficiency level={level} isWltp t={t} /> : t('vehicleProps:value.na');
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
wltpRange: {
|
|
1240
|
+
title: t('vehicleProps:title.wltpRange'),
|
|
1241
|
+
get value() {
|
|
1242
|
+
const wltpRange = car.battery && car.battery.wltpRange;
|
|
1243
|
+
return Number.isFinite(wltpRange)
|
|
1244
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRange.toLocaleString(language) })
|
|
1245
|
+
: t('vehicleProps:value.na');
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
wltpTotalRange: {
|
|
1249
|
+
title: t('vehicleProps:title.wltpTotalRange'),
|
|
1250
|
+
get value() {
|
|
1251
|
+
const wltpTotalRange = car.battery && car.battery.wltpTotalRange;
|
|
1252
|
+
return Number.isFinite(wltpTotalRange)
|
|
1253
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRange.toLocaleString(language) })
|
|
1254
|
+
: t('vehicleProps:value.na');
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
|
|
1258
|
+
wltpRangeCity: {
|
|
1259
|
+
title: t('vehicleProps:title.wltpRangeCity'),
|
|
1260
|
+
get value() {
|
|
1261
|
+
const wltpRangeCity = car.battery && car.battery.wltpRangeCity;
|
|
1262
|
+
return Number.isFinite(wltpRangeCity)
|
|
1263
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpRangeCity.toLocaleString(language) })
|
|
1264
|
+
: t('vehicleProps:value.na');
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
wltpTotalRangeCity: {
|
|
1268
|
+
title: t('vehicleProps:title.wltpTotalRangeCity'),
|
|
1269
|
+
get value() {
|
|
1270
|
+
const wltpTotalRangeCity = car.battery && car.battery.wltpTotalRangeCity;
|
|
1271
|
+
return Number.isFinite(wltpTotalRangeCity)
|
|
1272
|
+
? t('vehicleProps:value.batteryRangeElectric', { consumption: wltpTotalRangeCity.toLocaleString(language) })
|
|
1273
|
+
: t('vehicleProps:value.na');
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
wltpWeightedCombined: {
|
|
1277
|
+
title: t('vehicleProps:title.wltpWeightedCombined'),
|
|
1278
|
+
get value() {
|
|
1279
|
+
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
1280
|
+
return Number.isFinite(wltpWeightedCombined)
|
|
1281
|
+
? t('vehicleProps:value.consumptionCombined', { consumption: wltpWeightedCombined.toLocaleString(language) })
|
|
1282
|
+
: t('vehicleProps:value.na');
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
wltpCombined: {
|
|
1286
|
+
title: t('vehicleProps:title.wltpCombined'),
|
|
1287
|
+
get value() {
|
|
1288
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
1289
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1290
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1291
|
+
return Number.isFinite(wltpCombined)
|
|
1292
|
+
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1293
|
+
: t('vehicleProps:value.na');
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
wltpCombinedGas: {
|
|
1297
|
+
title: t('vehicleProps:title.wltpCombined'),
|
|
1298
|
+
get value() {
|
|
1299
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
1300
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1301
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1302
|
+
return Number.isFinite(wltpCombined)
|
|
1303
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1304
|
+
: t('vehicleProps:value.na');
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
wltpCombinedPlugin: {
|
|
1308
|
+
title: t('vehicleProps:title.wltpCombinedPlugin'),
|
|
1309
|
+
get value() {
|
|
1310
|
+
const wltpCombined = car.consumption.wltpCombined;
|
|
1311
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1312
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1313
|
+
return Number.isFinite(wltpCombined)
|
|
1314
|
+
? t('vehicleProps:value.consumption', { consumption: wltpCombined.toLocaleString(language), unit: translatedUnit })
|
|
1315
|
+
: t('vehicleProps:value.na');
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
wltpSlow: {
|
|
1319
|
+
title: t('vehicleProps:title.wltpSlow'),
|
|
1320
|
+
get value() {
|
|
1321
|
+
const wltpSlow = car.consumption.wltpSlow;
|
|
1322
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1323
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1324
|
+
return Number.isFinite(wltpSlow)
|
|
1325
|
+
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1326
|
+
: t('vehicleProps:value.na');
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
wltpSlowGas: {
|
|
1330
|
+
title: t('vehicleProps:title.wltpSlow'),
|
|
1331
|
+
get value() {
|
|
1332
|
+
const wltpSlow = car.consumption.wltpSlow;
|
|
1333
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1334
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1335
|
+
return Number.isFinite(wltpSlow)
|
|
1336
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1337
|
+
: t('vehicleProps:value.na');
|
|
1338
|
+
}
|
|
1339
|
+
},
|
|
1340
|
+
wltpSlowPlugin: {
|
|
1341
|
+
title: t('vehicleProps:title.wltpSlowPlugin'),
|
|
1342
|
+
get value() {
|
|
1343
|
+
const wltpSlow = car.consumption.wltpSlow;
|
|
1344
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1345
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1346
|
+
return Number.isFinite(wltpSlow)
|
|
1347
|
+
? t('vehicleProps:value.consumption', { consumption: wltpSlow.toLocaleString(language), unit: translatedUnit })
|
|
1348
|
+
: t('vehicleProps:value.na');
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
wltpMedium: {
|
|
1352
|
+
title: t('vehicleProps:title.wltpMedium'),
|
|
1353
|
+
get value() {
|
|
1354
|
+
const wltpMedium = car.consumption.wltpMedium;
|
|
1355
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1356
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1357
|
+
return Number.isFinite(wltpMedium)
|
|
1358
|
+
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1359
|
+
: t('vehicleProps:value.na');
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
wltpMediumGas: {
|
|
1363
|
+
title: t('vehicleProps:title.wltpMedium'),
|
|
1364
|
+
get value() {
|
|
1365
|
+
const wltpMedium = car.consumption.wltpMedium;
|
|
1366
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1367
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1368
|
+
return Number.isFinite(wltpMedium)
|
|
1369
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1370
|
+
: t('vehicleProps:value.na');
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
wltpMediumPlugin: {
|
|
1374
|
+
title: t('vehicleProps:title.wltpMediumPlugin'),
|
|
1375
|
+
get value() {
|
|
1376
|
+
const wltpMedium = car.consumption.wltpMedium;
|
|
1377
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1378
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1379
|
+
return Number.isFinite(wltpMedium)
|
|
1380
|
+
? t('vehicleProps:value.consumption', { consumption: wltpMedium.toLocaleString(language), unit: translatedUnit })
|
|
1381
|
+
: t('vehicleProps:value.na');
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
wltpFast: {
|
|
1385
|
+
title: t('vehicleProps:title.wltpFast'),
|
|
1386
|
+
get value() {
|
|
1387
|
+
const wltpFast = car.consumption.wltpFast;
|
|
1388
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1389
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1390
|
+
return Number.isFinite(wltpFast)
|
|
1391
|
+
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1392
|
+
: t('vehicleProps:value.na');
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
wltpFastGas: {
|
|
1396
|
+
title: t('vehicleProps:title.wltpFast'),
|
|
1397
|
+
get value() {
|
|
1398
|
+
const wltpFast = car.consumption.wltpFast;
|
|
1399
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1400
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1401
|
+
return Number.isFinite(wltpFast)
|
|
1402
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1403
|
+
: t('vehicleProps:value.na');
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
wltpFastPlugin: {
|
|
1407
|
+
title: t('vehicleProps:title.wltpFastPlugin'),
|
|
1408
|
+
get value() {
|
|
1409
|
+
const wltpFast = car.consumption.wltpFast;
|
|
1410
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1411
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1412
|
+
return Number.isFinite(wltpFast)
|
|
1413
|
+
? t('vehicleProps:value.consumption', { consumption: wltpFast.toLocaleString(language), unit: translatedUnit })
|
|
1414
|
+
: t('vehicleProps:value.na');
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
wltpVeryFast: {
|
|
1418
|
+
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1419
|
+
get value() {
|
|
1420
|
+
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1421
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1422
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1423
|
+
return Number.isFinite(wltpVeryFast)
|
|
1424
|
+
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1425
|
+
: t('vehicleProps:value.na');
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
wltpVeryFastGas: {
|
|
1429
|
+
title: t('vehicleProps:title.wltpVeryFast'),
|
|
1430
|
+
get value() {
|
|
1431
|
+
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1432
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1433
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1434
|
+
return Number.isFinite(wltpVeryFast)
|
|
1435
|
+
? t('vehicleProps:value.consumptionGas', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1436
|
+
: t('vehicleProps:value.na');
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
wltpVeryFastPlugin: {
|
|
1440
|
+
title: t('vehicleProps:title.wltpVeryFastPlugin'),
|
|
1441
|
+
get value() {
|
|
1442
|
+
const wltpVeryFast = car.consumption.wltpVeryFast;
|
|
1443
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1444
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1445
|
+
return Number.isFinite(wltpVeryFast)
|
|
1446
|
+
? t('vehicleProps:value.consumption', { consumption: wltpVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1447
|
+
: t('vehicleProps:value.na');
|
|
1448
|
+
}
|
|
1449
|
+
},
|
|
1450
|
+
wltpWeightedPowerCombined: {
|
|
1451
|
+
title: t('vehicleProps:title.wltpWeightedPowerCombined'),
|
|
1452
|
+
get value() {
|
|
1453
|
+
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
1454
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1455
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1456
|
+
return Number.isFinite(wltpWeightedPowerCombined)
|
|
1457
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1458
|
+
: t('vehicleProps:value.na');
|
|
1459
|
+
}
|
|
1460
|
+
},
|
|
1461
|
+
wltpPowerCombined: {
|
|
1462
|
+
title: t('vehicleProps:title.wltpPowerCombined'),
|
|
1463
|
+
get value() {
|
|
1464
|
+
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1465
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1466
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1467
|
+
return Number.isFinite(wltpPowerCombined)
|
|
1468
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1469
|
+
: t('vehicleProps:value.na');
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
wltpPowerSlow: {
|
|
1473
|
+
title: t('vehicleProps:title.wltpPowerSlow'),
|
|
1474
|
+
get value() {
|
|
1475
|
+
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1476
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1477
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1478
|
+
return Number.isFinite(wltpPowerSlow)
|
|
1479
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1480
|
+
: t('vehicleProps:value.na');
|
|
1481
|
+
}
|
|
1482
|
+
},
|
|
1483
|
+
wltpPowerMedium: {
|
|
1484
|
+
title: t('vehicleProps:title.wltpPowerMedium'),
|
|
1485
|
+
get value() {
|
|
1486
|
+
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1487
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1488
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1489
|
+
return Number.isFinite(wltpPowerMedium)
|
|
1490
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1491
|
+
: t('vehicleProps:value.na');
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
wltpPowerFast: {
|
|
1495
|
+
title: t('vehicleProps:title.wltpPowerFast'),
|
|
1496
|
+
get value() {
|
|
1497
|
+
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1498
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1499
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1500
|
+
return Number.isFinite(wltpPowerFast)
|
|
1501
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1502
|
+
: t('vehicleProps:value.na');
|
|
1503
|
+
}
|
|
1504
|
+
},
|
|
1505
|
+
wltpPowerVeryFast: {
|
|
1506
|
+
title: t('vehicleProps:title.wltpPowerVeryFast'),
|
|
1507
|
+
get value() {
|
|
1508
|
+
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1509
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1510
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1511
|
+
return Number.isFinite(wltpPowerVeryFast)
|
|
1512
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1513
|
+
: t('vehicleProps:value.na');
|
|
1514
|
+
}
|
|
1515
|
+
},
|
|
1516
|
+
wltpPowerCombinedPlugin: {
|
|
1517
|
+
title: t('vehicleProps:title.wltpPowerCombined'),
|
|
1518
|
+
get value() {
|
|
1519
|
+
const wltpPowerCombined = car.consumption.wltpPowerCombined;
|
|
1520
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1521
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1522
|
+
return Number.isFinite(wltpPowerCombined)
|
|
1523
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
1524
|
+
: t('vehicleProps:value.na');
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
wltpPowerSlowPlugin: {
|
|
1528
|
+
title: t('vehicleProps:title.wltpPowerSlow'),
|
|
1529
|
+
get value() {
|
|
1530
|
+
const wltpPowerSlow = car.consumption.wltpPowerSlow;
|
|
1531
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1532
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1533
|
+
return Number.isFinite(wltpPowerSlow)
|
|
1534
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerSlow.toLocaleString(language), unit: translatedUnit })
|
|
1535
|
+
: t('vehicleProps:value.na');
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1538
|
+
wltpPowerMediumPlugin: {
|
|
1539
|
+
title: t('vehicleProps:title.wltpPowerMedium'),
|
|
1540
|
+
get value() {
|
|
1541
|
+
const wltpPowerMedium = car.consumption.wltpPowerMedium;
|
|
1542
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1543
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1544
|
+
return Number.isFinite(wltpPowerMedium)
|
|
1545
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerMedium.toLocaleString(language), unit: translatedUnit })
|
|
1546
|
+
: t('vehicleProps:value.na');
|
|
1547
|
+
}
|
|
1548
|
+
},
|
|
1549
|
+
wltpPowerFastPlugin: {
|
|
1550
|
+
title: t('vehicleProps:title.wltpPowerFast'),
|
|
1551
|
+
get value() {
|
|
1552
|
+
const wltpPowerFast = car.consumption.wltpPowerFast;
|
|
1553
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1554
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1555
|
+
return Number.isFinite(wltpPowerFast)
|
|
1556
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerFast.toLocaleString(language), unit: translatedUnit })
|
|
1557
|
+
: t('vehicleProps:value.na');
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
wltpPowerVeryFastPlugin: {
|
|
1561
|
+
title: t('vehicleProps:title.wltpPowerVeryFast'),
|
|
1562
|
+
get value() {
|
|
1563
|
+
const wltpPowerVeryFast = car.consumption.wltpPowerVeryFast;
|
|
1564
|
+
const consumptionUnit = car.consumption.consumptionUnit || 'consumption_consumptionUnit_l';
|
|
1565
|
+
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
1566
|
+
return Number.isFinite(wltpPowerVeryFast)
|
|
1567
|
+
? t('vehicleProps:value.consumptionPower', { consumption: wltpPowerVeryFast.toLocaleString(language), unit: translatedUnit })
|
|
1568
|
+
: t('vehicleProps:value.na');
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1571
|
+
wltpEnergyCosts: {
|
|
1572
|
+
title: t('vehicleProps:title.wltpEnergyCosts'),
|
|
1573
|
+
get value() {
|
|
1574
|
+
const { fuel } = car.consumption;
|
|
1575
|
+
const { wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined } = car.consumption;
|
|
1576
|
+
const { powerPrice, fuelPrice } = car.costModel;
|
|
1577
|
+
const powerCost = {
|
|
1578
|
+
fuelPrice,
|
|
1579
|
+
powerPrice
|
|
1580
|
+
}
|
|
1581
|
+
const { hybridPlugin } = car.engineData;
|
|
1582
|
+
const consumption = {
|
|
1583
|
+
wltpCombined, wltpPowerCombined, wltpWeightedCombined, wltpWeightedPowerCombined
|
|
1584
|
+
}
|
|
1585
|
+
const { getFuelPrice } = financingUtils;
|
|
1586
|
+
const fuelCost = getFuelPrice(fuel, consumption, hybridPlugin, powerCost);
|
|
1587
|
+
return Number.isFinite(fuelCost)
|
|
1588
|
+
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(fuelCost, '$,.2f') })
|
|
1589
|
+
: t('vehicleProps:value.na');
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
wltpCo2CostsLow: {
|
|
1593
|
+
get title() {
|
|
1594
|
+
const { co2DefaultCostsLow } = financingUtils;
|
|
1595
|
+
return t('vehicleProps:title.wltpCo2LowPrice', { price: co2DefaultCostsLow })
|
|
1596
|
+
},
|
|
1597
|
+
get value() {
|
|
1598
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1599
|
+
|
|
1600
|
+
const { getCo2Price } = financingUtils;
|
|
1601
|
+
const { co2PriceLow } = getCo2Price(wltpCo2);
|
|
1602
|
+
return Number.isFinite(co2PriceLow)
|
|
1603
|
+
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceLow, '$,.2f') })
|
|
1604
|
+
: t('vehicleProps:value.na');
|
|
1605
|
+
},
|
|
1606
|
+
get valueDescription() {
|
|
1607
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1608
|
+
|
|
1609
|
+
const { getCo2Price } = financingUtils;
|
|
1610
|
+
const { co2PriceLow } = getCo2Price(wltpCo2);
|
|
1611
|
+
return Number.isFinite(co2PriceLow) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1612
|
+
}
|
|
1613
|
+
},
|
|
1614
|
+
wltpCo2CostsMiddle: {
|
|
1615
|
+
get title() {
|
|
1616
|
+
const { co2DefaultCostsMedium } = financingUtils;
|
|
1617
|
+
return t('vehicleProps:title.wltpCo2MidPrice', { price: co2DefaultCostsMedium })
|
|
1618
|
+
},
|
|
1619
|
+
get value() {
|
|
1620
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1621
|
+
|
|
1622
|
+
const { getCo2Price } = financingUtils;
|
|
1623
|
+
const { co2PriceMedium } = getCo2Price(wltpCo2);
|
|
1624
|
+
return Number.isFinite(co2PriceMedium)
|
|
1625
|
+
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceMedium, '$,.2f') })
|
|
1626
|
+
: t('vehicleProps:value.na');
|
|
1627
|
+
},
|
|
1628
|
+
get valueDescription() {
|
|
1629
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1630
|
+
|
|
1631
|
+
const { getCo2Price } = financingUtils;
|
|
1632
|
+
const { co2PriceMedium } = getCo2Price(wltpCo2);
|
|
1633
|
+
return Number.isFinite(co2PriceMedium) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1634
|
+
}
|
|
1635
|
+
},
|
|
1636
|
+
wltpCo2CostsHigh: {
|
|
1637
|
+
get title() {
|
|
1638
|
+
const { co2DefaultCostsHigh } = financingUtils;
|
|
1639
|
+
return t('vehicleProps:title.wltpCo2HighPrice', { price: co2DefaultCostsHigh })
|
|
1640
|
+
},
|
|
1641
|
+
get value() {
|
|
1642
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1643
|
+
|
|
1644
|
+
const { getCo2Price } = financingUtils;
|
|
1645
|
+
const { co2PriceHigh } = getCo2Price(wltpCo2);
|
|
1646
|
+
return Number.isFinite(co2PriceHigh)
|
|
1647
|
+
? t('vehicleProps:value.wltpCo2Price', { price: getFormattedPrice(co2PriceHigh, '$,.2f') })
|
|
1648
|
+
: t('vehicleProps:value.na');
|
|
1649
|
+
},
|
|
1650
|
+
get valueDescription() {
|
|
1651
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1652
|
+
|
|
1653
|
+
const { getCo2Price } = financingUtils;
|
|
1654
|
+
const { co2PriceHigh } = getCo2Price(wltpCo2);
|
|
1655
|
+
return Number.isFinite(co2PriceHigh) ? t('vehicleProps:value.wltpCo2PriceSpec') : '';
|
|
1656
|
+
}
|
|
1657
|
+
},
|
|
1658
|
+
powerPrice: {
|
|
1659
|
+
title: t('vehicleProps:title.powerPrice'),
|
|
1660
|
+
get value() {
|
|
1661
|
+
const fuel = car.consumption.fuel;
|
|
1662
|
+
const { hybridPlugin } = car.engineData;
|
|
1663
|
+
|
|
1664
|
+
const { getBaseFuelPrice } = financingUtils;
|
|
1665
|
+
|
|
1666
|
+
const basePowerPrice = getBaseFuelPrice(fuel, hybridPlugin).powerPrice;
|
|
1667
|
+
const powerPrice = car.costModel.powerPrice ? car.costModel.powerPrice : basePowerPrice;
|
|
1668
|
+
|
|
1669
|
+
return Number.isFinite(powerPrice)
|
|
1670
|
+
? t('vehicleProps:value.powerPrice', { price: getFormattedPrice(powerPrice, '$,.2f') })
|
|
1671
|
+
: t('vehicleProps:value.na');
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
fuelPrice: {
|
|
1675
|
+
title: t('vehicleProps:title.fuelPrice'),
|
|
1676
|
+
get value() {
|
|
1677
|
+
const fuel = car.consumption.fuel;
|
|
1678
|
+
const { hybridPlugin } = car.engineData;
|
|
1679
|
+
|
|
1680
|
+
const { getBaseFuelPrice } = financingUtils;
|
|
1681
|
+
|
|
1682
|
+
const baseFuelPrice = getBaseFuelPrice(fuel, hybridPlugin) ? getBaseFuelPrice(fuel, hybridPlugin).fuelPrice : null;
|
|
1683
|
+
|
|
1684
|
+
const fuelPrice = car.costModel.fuelPrice ? car.costModel.fuelPrice : baseFuelPrice;
|
|
1685
|
+
return Number.isFinite(fuelPrice)
|
|
1686
|
+
? t('vehicleProps:value.fuelPrice', { price: getFormattedPrice(fuelPrice, '$,.2f') })
|
|
1687
|
+
: t('vehicleProps:value.na');
|
|
1688
|
+
}
|
|
1689
|
+
},
|
|
1690
|
+
consumptionPriceYear: {
|
|
1691
|
+
title: t('vehicleProps:title.consumptionPriceYear'),
|
|
1692
|
+
get value() {
|
|
1693
|
+
const { consumptionPriceYear } = car.costModel;
|
|
1694
|
+
return Number.isFinite(consumptionPriceYear)
|
|
1695
|
+
? consumptionPriceYear
|
|
1696
|
+
: t('vehicleProps:value.na');
|
|
1697
|
+
}
|
|
1698
|
+
},
|
|
1699
|
+
wltpCostModelTax: {
|
|
1700
|
+
title: t('vehicleProps:title.wltpVehicleTax'),
|
|
1701
|
+
get value() {
|
|
1702
|
+
const cubicCapacity = car.engineData.cubicCapacity;
|
|
1703
|
+
const fuel = car.consumption.fuel;
|
|
1704
|
+
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
1705
|
+
const { getVehicleTax } = financingUtils;
|
|
1706
|
+
const tax = car.costModel.tax ? car.costModel.tax : getVehicleTax(fuel, cubicCapacity, wltpCo2, firstRegistration);
|
|
1707
|
+
return Number.isFinite(tax)
|
|
1708
|
+
? t('vehicleProps:value.pricePerYear', { price: getFormattedPrice(tax, '$,.2f') })
|
|
1709
|
+
: t('vehicleProps:value.na');
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
};
|
|
1714
|
+
return props;
|
|
1715
|
+
};
|
|
1716
|
+
|
|
1717
|
+
export default getDecoratedProps;
|