@bytebrand/fe-ui-core-autobahn 1.0.212 → 1.0.213
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.
- package/cards/cardParts.tsx +1368 -1368
- package/cards/types.ts +182 -182
- package/data/toAutobahnCar.ts +600 -600
- package/locales/de/autobahn.json +901 -891
- package/locales/en/autobahn.json +901 -891
- package/package.json +30 -30
- package/theme/md3.css +15807 -15678
- package/ui/CreditKeyFigures.tsx +244 -244
- package/ui/Stars.tsx +36 -18
- package/ui/index.ts +96 -96
- package/vdp/FinanceCalculator.tsx +1148 -1148
- package/vdp/VdpModules.tsx +3994 -3869
- package/vdp/index.ts +6 -0
- package/vdp/types.ts +20 -0
|
@@ -1,1148 +1,1148 @@
|
|
|
1
|
-
// Autobahn (auto.de redesign) — VDP offer / finance card (Finanzierung / Leasing /
|
|
2
|
-
// Barzahlung).
|
|
3
|
-
//
|
|
4
|
-
// Structure (desktop rethink, tabs-on-top): payment-type TABS at the top (MD3 underline tabs),
|
|
5
|
-
// then the rate (with any discount), then the "Rate anpassen" rate-editor, then the primary
|
|
6
|
-
// "Angebot sichern" request CTA, and finally the Finanzierungs-/Leasingdetails info + popup link
|
|
7
|
-
// at the foot. Laufzeit is chosen via chips (discrete terms), not a slider.
|
|
8
|
-
//
|
|
9
|
-
// CONTROLLED / PRESENTATIONAL — computes NOTHING financial: `mode`, `monthly`, `down`, `term` and
|
|
10
|
-
// the slider/chip bounds all arrive as props; segment/slider/chip changes are reported back via
|
|
11
|
-
// `onModeChange` / `onDownChange` / `onTermChange`. The real numbers come from `financingStore`.
|
|
12
|
-
// The only local state is the `adjust` expander (pure view state).
|
|
13
|
-
//
|
|
14
|
-
// Renders correctly only inside a `<div className="md3">` subtree.
|
|
15
|
-
|
|
16
|
-
import React, { useState, useEffect } from 'react';
|
|
17
|
-
import { TranslationFunction } from '../types';
|
|
18
|
-
|
|
19
|
-
import { Button, Icon, Switch, CreditCostNotice, CreditKeyFigures, hasCreditKeyFigures } from '../ui';
|
|
20
|
-
import type { CreditKeyFiguresData } from '../ui';
|
|
21
|
-
import { TIER_LABELS, TIER_KEYS, TIER_COLORS } from '../constants';
|
|
22
|
-
|
|
23
|
-
/** Payment mode segment keys. Mirrors the design's ['fin','leasing','cash']. */
|
|
24
|
-
export type FinanceMode = 'fin' | 'leasing' | 'cash';
|
|
25
|
-
|
|
26
|
-
export interface SliderProps {
|
|
27
|
-
min: number;
|
|
28
|
-
max: number;
|
|
29
|
-
step?: number;
|
|
30
|
-
value: number;
|
|
31
|
-
onChange: (value: number) => void;
|
|
32
|
-
/** formats the min/max end labels (and is reused by callers for the value). */
|
|
33
|
-
fmt?: (v: number) => React.ReactNode;
|
|
34
|
-
/** render the current value in a floating bubble above the thumb (Figma sheet sliders). */
|
|
35
|
-
bubble?: boolean;
|
|
36
|
-
/** space reserved below the rail for the bubble's tail (Figma differs per sheet: fin vs leasing). */
|
|
37
|
-
bubblePaddingBottom?: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Range slider with a filled track and min/max end labels. The track fill is a
|
|
42
|
-
* linear-gradient driven by the value's position; the design's `.mslider` class
|
|
43
|
-
* styles the thumb/rail. With `bubble` the current value floats above the thumb
|
|
44
|
-
* (mockup "Rate anpassen" sliders) instead of the caller printing it elsewhere.
|
|
45
|
-
*/
|
|
46
|
-
export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
47
|
-
min,
|
|
48
|
-
max,
|
|
49
|
-
step = 1,
|
|
50
|
-
value,
|
|
51
|
-
onChange,
|
|
52
|
-
fmt = (v) => v,
|
|
53
|
-
bubble,
|
|
54
|
-
bubblePaddingBottom = 34,
|
|
55
|
-
}) => {
|
|
56
|
-
// Local mirror of `value`, updated INSTANTLY on every native input event. Callers commonly
|
|
57
|
-
// debounce their own onChange (e.g. CheckoutFinancePanelNext's 50ms setCommonUserConfig,
|
|
58
|
-
// which also triggers a MobX-driven re-render of a much bigger subtree) — without this, the
|
|
59
|
-
// thumb still drags natively/smoothly (the browser owns that), but the gradient fill and any
|
|
60
|
-
// bubble label are driven by the `value` PROP, which only catches up once the debounced commit
|
|
61
|
-
// finally lands, so the fill visibly lags/stutters behind the thumb during a fast drag. Synced
|
|
62
|
-
// back to the prop via useEffect for externally-driven changes (e.g. a reset button).
|
|
63
|
-
const [localValue, setLocalValue] = useState(value);
|
|
64
|
-
useEffect(() => { setLocalValue(value); }, [value]);
|
|
65
|
-
|
|
66
|
-
const span = max - min;
|
|
67
|
-
const pct = span > 0 ? ((localValue - min) / span) * 100 : 0;
|
|
68
|
-
return (
|
|
69
|
-
<div>
|
|
70
|
-
<div style={{ position: 'relative', paddingTop: bubble ? 44 : 0, paddingBottom: bubble ? bubblePaddingBottom : 0 }}>
|
|
71
|
-
{bubble && (
|
|
72
|
-
// thumb is 22px wide: interpolate the bubble anchor between half-thumb insets so it
|
|
73
|
-
// tracks the thumb center (a plain pct% drifts at the rail ends)
|
|
74
|
-
<span className="slider-bubble num" style={{ left: `calc(11px + (100% - 22px) * ${pct / 100})` }}>
|
|
75
|
-
{fmt(localValue)}
|
|
76
|
-
</span>
|
|
77
|
-
)}
|
|
78
|
-
<input
|
|
79
|
-
type="range"
|
|
80
|
-
className="mslider"
|
|
81
|
-
min={min}
|
|
82
|
-
max={max}
|
|
83
|
-
step={step}
|
|
84
|
-
value={localValue}
|
|
85
|
-
onChange={(e) => {
|
|
86
|
-
const v = Number(e.target.value);
|
|
87
|
-
setLocalValue(v);
|
|
88
|
-
onChange(v);
|
|
89
|
-
}}
|
|
90
|
-
style={{ background: `linear-gradient(90deg, var(--md-primary) ${pct}%, var(--md-sc-highest) ${pct}%)` }}
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
{!bubble && (
|
|
94
|
-
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 4 }}>
|
|
95
|
-
<span className="md-label-sm">{fmt(min)}</span>
|
|
96
|
-
<span className="md-label-sm">{fmt(max)}</span>
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
</div>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Segmented price-evaluation bar (Figma: 5 discrete tier segments, NOT a gradient) with a
|
|
105
|
-
* white ring marker. `leftPct` overrides the marker position (the Marktwert gauge positions
|
|
106
|
-
* it continuously); default = centered on the tier segment.
|
|
107
|
-
*/
|
|
108
|
-
export const EvalBar: React.FunctionComponent<{ tier: number; leftPct?: number }> = ({ tier, leftPct }) => (
|
|
109
|
-
<div className="fin-eval-bar">
|
|
110
|
-
{TIER_COLORS.map((c, i) => (
|
|
111
|
-
<span key={i} className="fin-eval-seg" style={{ background: c }} />
|
|
112
|
-
))}
|
|
113
|
-
<div
|
|
114
|
-
className={`fin-eval-thumb${TIER_KEYS[Math.max(0, Math.min(4, tier))] === 'good' ? ' fin-eval-thumb--good' : ''}`}
|
|
115
|
-
style={{ left: `${leftPct != null ? leftPct : (tier + 0.5) * 20}%`, borderColor: TIER_COLORS[Math.max(0, Math.min(4, tier))] }}
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
/** Figma CTA icon — document with a check-in-circle badge over its bottom-right corner
|
|
121
|
-
* (no single lucide glyph matches; composed from file-text + a knocked-out check-circle).
|
|
122
|
-
* The badge backdrop assumes a filled (primary) button. */
|
|
123
|
-
export const DocCheckIcon: React.FunctionComponent<{ size?: number }> = ({ size = 19 }) => {
|
|
124
|
-
// inline width/height on BOTH icons — `.mbtn .lucide { width/height: 18px }` otherwise
|
|
125
|
-
// inflates the badge to full icon size and it swallows the document
|
|
126
|
-
const badge = Math.max(9, Math.round(size * 0.5));
|
|
127
|
-
return (
|
|
128
|
-
<span style={{ position: 'relative', display: 'inline-flex', flex: 'none' }}>
|
|
129
|
-
<Icon name="file-text" size={size} stroke={2} style={{ width: size, height: size }} />
|
|
130
|
-
<span
|
|
131
|
-
style={{
|
|
132
|
-
position: 'absolute',
|
|
133
|
-
right: -3,
|
|
134
|
-
bottom: -2,
|
|
135
|
-
display: 'flex',
|
|
136
|
-
borderRadius: '50%',
|
|
137
|
-
background: 'var(--md-primary)',
|
|
138
|
-
padding: 1,
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<Icon name="check-circle" size={badge} stroke={2.8} style={{ width: badge, height: badge }} />
|
|
142
|
-
</span>
|
|
143
|
-
</span>
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export interface TermChipsProps {
|
|
148
|
-
/** the selectable term values (months), e.g. [12,24,36,48,60,72]. */
|
|
149
|
-
options: number[];
|
|
150
|
-
value: number;
|
|
151
|
-
onChange: (term: number) => void;
|
|
152
|
-
/** i18n function (drilled from the page). */
|
|
153
|
-
t: TranslationFunction;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** Laufzeit selector — discrete term values as tappable chips (replaces the fiddly slider). */
|
|
157
|
-
export const TermChips: React.FunctionComponent<TermChipsProps> = ({ options, value, onChange, t }) => (
|
|
158
|
-
<div className="term-chips" role="group" aria-label={t('autobahn:finance.termSelection')}>
|
|
159
|
-
{options.map((m) => (
|
|
160
|
-
<button
|
|
161
|
-
key={m}
|
|
162
|
-
type="button"
|
|
163
|
-
aria-pressed={m === value}
|
|
164
|
-
className={'term-chip' + (m === value ? ' on' : '')}
|
|
165
|
-
onClick={() => onChange(m)}
|
|
166
|
-
>
|
|
167
|
-
{m}
|
|
168
|
-
<span className="tc-unit">{t('autobahn:finance.monthUnit')}</span>
|
|
169
|
-
</button>
|
|
170
|
-
))}
|
|
171
|
-
</div>
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
export interface CalcRowProps {
|
|
175
|
-
label: React.ReactNode;
|
|
176
|
-
/** when true, drops the bottom hairline (last row). */
|
|
177
|
-
last?: boolean;
|
|
178
|
-
children?: React.ReactNode;
|
|
179
|
-
className?: string;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** One label/value row inside the "Rate anpassen" / "Details" expander. */
|
|
183
|
-
export const CalcRow: React.FunctionComponent<CalcRowProps> = ({ label, last, children, className }) => (
|
|
184
|
-
<div
|
|
185
|
-
className={'calcrow' + (className ? ' ' + className : '')}
|
|
186
|
-
style={{
|
|
187
|
-
display: 'flex',
|
|
188
|
-
justifyContent: 'space-between',
|
|
189
|
-
alignItems: 'baseline',
|
|
190
|
-
gap: 12,
|
|
191
|
-
padding: '8px 0',
|
|
192
|
-
borderBottom: last ? 0 : '1px solid var(--md-outline-variant)',
|
|
193
|
-
}}
|
|
194
|
-
>
|
|
195
|
-
<span className="md-label-sm calcrow-label">{label}</span>
|
|
196
|
-
<span className="num calcrow-value" style={{ fontSize: 13.5, fontWeight: 600 }}>
|
|
197
|
-
{children}
|
|
198
|
-
</span>
|
|
199
|
-
</div>
|
|
200
|
-
);
|
|
201
|
-
|
|
202
|
-
/** full-width label(+optional trailing price) / Switch row — Switch itself is inline-flex
|
|
203
|
-
* (track+label), so the "label ...... price switch" full-row layout can't be expressed via
|
|
204
|
-
* Switch's `label` prop (which renders track-then-label, not a full-width justified row). */
|
|
205
|
-
export const ToggleRow: React.FunctionComponent<{
|
|
206
|
-
label: string;
|
|
207
|
-
price?: string;
|
|
208
|
-
checked: boolean;
|
|
209
|
-
disabled?: boolean;
|
|
210
|
-
onChange: (checked: boolean) => void;
|
|
211
|
-
className?: string;
|
|
212
|
-
/** cash mode: the package is always included — shows a static "inklusive" note instead of the switch. */
|
|
213
|
-
staticNote?: string;
|
|
214
|
-
/** when set, the info icon becomes clickable and opens a popover with this body (e.g. the
|
|
215
|
-
* Rundum-Sorglos-Paket contents) — "Mit Schlussrate" rows omit this, keeping their icon inert. */
|
|
216
|
-
tooltip?: React.ReactNode;
|
|
217
|
-
/** aria-label for the popover's close button — required together with `tooltip`. */
|
|
218
|
-
tooltipCloseLabel?: string;
|
|
219
|
-
/** required together with `tooltip` — builds the trigger's own accessible name (see `infoLabel` below). */
|
|
220
|
-
t?: TranslationFunction;
|
|
221
|
-
}> = ({ label, price, checked, disabled, onChange, className, staticNote, tooltip, tooltipCloseLabel, t }) => {
|
|
222
|
-
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
223
|
-
const toggleTooltip = (e: { stopPropagation: () => void }) => {
|
|
224
|
-
e.stopPropagation();
|
|
225
|
-
setTooltipOpen((v) => !v);
|
|
226
|
-
};
|
|
227
|
-
// the visible label alone ("Rundum-Sorglos-Paket") reads as ambiguous out of context (toggle
|
|
228
|
-
// the package? show info about it?) — spell out what activating the trigger actually does.
|
|
229
|
-
const infoLabel = tooltip && t ? t('autobahn:finance.moreInfoAria', { label }) : undefined;
|
|
230
|
-
return (
|
|
231
|
-
<div
|
|
232
|
-
className={className}
|
|
233
|
-
style={{
|
|
234
|
-
display: 'flex',
|
|
235
|
-
alignItems: 'center',
|
|
236
|
-
justifyContent: staticNote ? undefined : 'space-between',
|
|
237
|
-
gap: 10,
|
|
238
|
-
position: tooltip ? 'relative' : undefined,
|
|
239
|
-
}}
|
|
240
|
-
>
|
|
241
|
-
<span className="md-title-sm" style={{ display: 'inline-flex', alignItems: 'center', gap: 5 }}>
|
|
242
|
-
{label}
|
|
243
|
-
{/* custom info glyph (not the shared lucide "info" from the Icon registry — that name is
|
|
244
|
-
used in many unrelated places, this swap is scoped to just the Rundum-Sorglos-Paket
|
|
245
|
-
tooltip trigger). Shared by all three tabs (Finanzierung/Leasing/Kaufen) and both
|
|
246
|
-
desktop/mobile — ToggleRow itself is the one shared render for all of them. Viewbox
|
|
247
|
-
already bounds every path (1.875–13.125 within 0–15), so no clip-path needed.
|
|
248
|
-
The interactive/focusable/touch-target element is THIS icon wrapper only — the label
|
|
249
|
-
text next to it is plain, inert text, not part of the trigger. */}
|
|
250
|
-
{tooltip && (
|
|
251
|
-
<span
|
|
252
|
-
className="fin-toggle-info-trigger"
|
|
253
|
-
style={{ display: 'inline-flex', cursor: 'pointer' }}
|
|
254
|
-
role="button"
|
|
255
|
-
tabIndex={0}
|
|
256
|
-
aria-label={infoLabel}
|
|
257
|
-
aria-expanded={tooltipOpen}
|
|
258
|
-
onClick={toggleTooltip}
|
|
259
|
-
onKeyDown={(e) => {
|
|
260
|
-
// ARIA authoring practices: a role="button" element must answer to both Enter and
|
|
261
|
-
// Space, not just Enter — a native <button> gets this for free, this span doesn't.
|
|
262
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
263
|
-
e.preventDefault();
|
|
264
|
-
toggleTooltip(e);
|
|
265
|
-
}
|
|
266
|
-
}}
|
|
267
|
-
>
|
|
268
|
-
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" className="lucide">
|
|
269
|
-
<path d="M7.5 13.125C10.6066 13.125 13.125 10.6066 13.125 7.5C13.125 4.3934 10.6066 1.875 7.5 1.875C4.3934 1.875 1.875 4.3934 1.875 7.5C1.875 10.6066 4.3934 13.125 7.5 13.125Z" stroke="#8B98AA" strokeWidth={1.8} />
|
|
270
|
-
<path d="M7.5 7.2V10.5125" stroke="#8B98AA" strokeWidth={1.8} strokeLinecap="round" />
|
|
271
|
-
<path d="M7.5 4.8125H7.50625" stroke="#8B98AA" strokeWidth={2.4} strokeLinecap="round" />
|
|
272
|
-
</svg>
|
|
273
|
-
</span>
|
|
274
|
-
)}
|
|
275
|
-
</span>
|
|
276
|
-
{tooltip && tooltipOpen && (
|
|
277
|
-
<div className="pp-uvp-tooltip fin-toggle-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
278
|
-
<button
|
|
279
|
-
type="button"
|
|
280
|
-
className="pp-uvp-tooltip-close fin-toggle-tooltip-close"
|
|
281
|
-
aria-label={tooltipCloseLabel}
|
|
282
|
-
onClick={(e) => {
|
|
283
|
-
e.stopPropagation();
|
|
284
|
-
setTooltipOpen(false);
|
|
285
|
-
}}
|
|
286
|
-
>
|
|
287
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
288
|
-
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
289
|
-
</svg>
|
|
290
|
-
</button>
|
|
291
|
-
<div className="pp-uvp-tooltip-body fin-toggle-tooltip-body">{tooltip}</div>
|
|
292
|
-
</div>
|
|
293
|
-
)}
|
|
294
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginLeft: staticNote ? 'auto' : undefined }}>
|
|
295
|
-
{/* staticNote (cash mode: package is always included, price already baked into the
|
|
296
|
-
fixed price above) fully replaces the price+switch pair — showing "+1.499 €" right
|
|
297
|
-
next to "inklusive" read as contradictory, so price is suppressed whenever
|
|
298
|
-
staticNote is set, not just the switch. */}
|
|
299
|
-
{price && !staticNote && (
|
|
300
|
-
<span className="num" style={{ fontWeight: 700, fontSize: 13.5 }}>
|
|
301
|
-
{price}
|
|
302
|
-
</span>
|
|
303
|
-
)}
|
|
304
|
-
{staticNote ? (
|
|
305
|
-
<span style={{ fontFamily: 'Arial, Arimo, sans-serif', fontWeight: 400, fontSize: 15, lineHeight: '17px', color: '#0E2238' }}>
|
|
306
|
-
{staticNote}
|
|
307
|
-
</span>
|
|
308
|
-
) : (
|
|
309
|
-
<Switch checked={checked} disabled={disabled} onChange={(e) => onChange(e.target.checked)} ariaLabel={label} />
|
|
310
|
-
)}
|
|
311
|
-
</div>
|
|
312
|
-
</div>
|
|
313
|
-
);
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
/** body content for the "Rundum-Sorglos-Paket" ToggleRow tooltip — intro sentence, bold heading,
|
|
317
|
-
* the package's contents as a bullet list, then (financing/leasing only) a closing paragraph
|
|
318
|
-
* explaining the one-off-vs-financed payment choice. Shared by every addServicesToggle
|
|
319
|
-
* ToggleRow (FinanceCalculator's own card + VdpModules' modal/mobile-sheet instances); intro/
|
|
320
|
-
* outro vary by mode since cash mode has no "financed into the rate" option. */
|
|
321
|
-
export const AddServicesTooltipBody: React.FunctionComponent<{ t: TranslationFunction; isCash?: boolean; isLease?: boolean }> = ({
|
|
322
|
-
t,
|
|
323
|
-
isCash,
|
|
324
|
-
isLease,
|
|
325
|
-
}) => (
|
|
326
|
-
<>
|
|
327
|
-
<p style={{ margin: '0 0 8px' }}>
|
|
328
|
-
{t(isCash ? 'autobahn:finance.addServicesTooltipIntroCash' : 'autobahn:finance.addServicesTooltipIntroFinanced')}
|
|
329
|
-
</p>
|
|
330
|
-
<p style={{ fontFamily: 'Arial, Arimo, sans-serif', fontWeight: 700, fontSize: 10, lineHeight: '13px', color: '#0E2238', margin: '0 0 4px' }}>
|
|
331
|
-
{t('autobahn:finance.addServicesTooltipHeading')}
|
|
332
|
-
</p>
|
|
333
|
-
<ul style={{ margin: 0, padding: '0 0 0 14px' }}>
|
|
334
|
-
{t('autobahn:finance.addServicesTooltipItems')
|
|
335
|
-
.split('\n')
|
|
336
|
-
.map((item) => (
|
|
337
|
-
<li key={item}>{item}</li>
|
|
338
|
-
))}
|
|
339
|
-
</ul>
|
|
340
|
-
{!isCash && (
|
|
341
|
-
<p style={{ margin: '8px 0 0' }}>
|
|
342
|
-
{t(isLease ? 'autobahn:finance.addServicesTooltipOutroLeasing' : 'autobahn:finance.addServicesTooltipOutroFinancing')}
|
|
343
|
-
</p>
|
|
344
|
-
)}
|
|
345
|
-
</>
|
|
346
|
-
);
|
|
347
|
-
|
|
348
|
-
export interface FinanceCalculatorProps {
|
|
349
|
-
/** active payment mode (controlled). */
|
|
350
|
-
mode: FinanceMode;
|
|
351
|
-
/** purchase price in EUR (the cash mode hero). */
|
|
352
|
-
price: number;
|
|
353
|
-
/** previous/list price — when > price, shown struck through as the UVP in cash mode (real discount). */
|
|
354
|
-
listPrice?: number;
|
|
355
|
-
/** auto.de-ID reference code — shown with the financing/leasing condition line. */
|
|
356
|
-
autoDeId?: string;
|
|
357
|
-
/** price-rating label, e.g. 'Guter Preis' — drives the Preisbewertung indicator. */
|
|
358
|
-
ratingLabel?: string;
|
|
359
|
-
/** computed monthly rate in EUR for the current mode — supplied, NOT computed here. */
|
|
360
|
-
monthly: number;
|
|
361
|
-
/** struck old monthly rate (fe-financing oldMonthlyInstallment, isStrikeShown-gated) —
|
|
362
|
-
* rendered as the red line-through figure next to the hero rate (fin/leasing only). */
|
|
363
|
-
oldMonthly?: number;
|
|
364
|
-
/** effective annual rate (%) for the current mode — supplied, NOT computed here. */
|
|
365
|
-
apr: number;
|
|
366
|
-
/** ADV-405 follow-up: financing key figures (Kerndaten) of the CURRENT calculation — the same
|
|
367
|
-
* financing-config values the Finanzierungsdetails layer shows (paybackPeriod, netLoanAmount,
|
|
368
|
-
* totalFinancingAmount else grossLoanAmount, nominalInterestRate, annualPercentageRate). When
|
|
369
|
-
* at least one is real, the financing conditions line shows them instead of "0 € Anzahlung ·
|
|
370
|
-
* 60 Monate". Financing only (leasing/Kaufen ignore it); omit to keep the old line. */
|
|
371
|
-
creditKeyFigures?: CreditKeyFiguresData;
|
|
372
|
-
/** ADV-405 follow-up (leasing confirmed 19.11): leasing key figures of the CURRENT leasing
|
|
373
|
-
* calculation (kind 'leasing', ui/CreditKeyFigures leasingKeyFigures — the Leasingdetails
|
|
374
|
-
* layer's own figures). Shown on the Leasing tab instead of "… Sonderzahlung · … Mon. · … km/Jahr"
|
|
375
|
-
* when at least one is real; omit to keep the old line. */
|
|
376
|
-
leasingKeyFigures?: CreditKeyFiguresData;
|
|
377
|
-
/** current down payment in EUR (controlled). */
|
|
378
|
-
down: number;
|
|
379
|
-
/** current term in months (controlled). */
|
|
380
|
-
term: number;
|
|
381
|
-
/** down-payment slider bounds. */
|
|
382
|
-
downMin: number;
|
|
383
|
-
downMax: number;
|
|
384
|
-
/** down-payment slider step (EUR). */
|
|
385
|
-
downStep?: number;
|
|
386
|
-
/** term slider bounds (months) — used to derive chip options when termOptions is absent. */
|
|
387
|
-
termMin: number;
|
|
388
|
-
termMax: number;
|
|
389
|
-
/** term slider step (months). */
|
|
390
|
-
termStep?: number;
|
|
391
|
-
/** the discrete selectable terms (months) for the Laufzeit chips. */
|
|
392
|
-
termOptions?: number[];
|
|
393
|
-
/** annual mileage in km (controlled) — leasing/financing Laufleistung/Jahr. Omit to hide the slider. */
|
|
394
|
-
annualMileage?: number;
|
|
395
|
-
/** annual-mileage slider bounds + step (km). */
|
|
396
|
-
annualMileageMin?: number;
|
|
397
|
-
annualMileageMax?: number;
|
|
398
|
-
annualMileageStep?: number;
|
|
399
|
-
/** annual-mileage slider changed. */
|
|
400
|
-
onAnnualMileageChange?: (km: number) => void;
|
|
401
|
-
/** "Mit Schlussrate" toggle state (financing only; leasing has no balloon concept). Omit
|
|
402
|
-
* onToggleFinalInstallment to hide the row. */
|
|
403
|
-
withFinalInstallment?: boolean;
|
|
404
|
-
onToggleFinalInstallment?: (checked: boolean) => void;
|
|
405
|
-
/** "Rundum-Sorglos-Paket" toggle state (fin/leasing). Omit addServicesCost or
|
|
406
|
-
* onToggleAddServices to hide the row. */
|
|
407
|
-
withAddServices?: boolean;
|
|
408
|
-
addServicesCost?: number;
|
|
409
|
-
addServicesDisabled?: boolean;
|
|
410
|
-
onToggleAddServices?: (checked: boolean) => void;
|
|
411
|
-
/** Kaufen tab only — real carStore.isAvailable, drives the Verfügbarkeit row (replaces the
|
|
412
|
-
* static Lieferung row). Same source as VdpTrustRow's "Sofort verfügbar" badge. */
|
|
413
|
-
available?: boolean;
|
|
414
|
-
/** phone number shown on the secondary CTA (touch only). */
|
|
415
|
-
phone?: string;
|
|
416
|
-
/** primary CTA click (Angebot sichern). */
|
|
417
|
-
onSecure?: () => void;
|
|
418
|
-
/** true once the customer already has an offer request/checkout in progress for this car —
|
|
419
|
-
* turns the primary CTA green (see .fin-cta-secured) instead of the default filled style. */
|
|
420
|
-
secured?: boolean;
|
|
421
|
-
/** overrides the primary CTA label while `secured` is true (e.g. "Zur Bestellung"). Ignored
|
|
422
|
-
* when `secured` is false — the CTA keeps its own default label in that case. */
|
|
423
|
-
secureLabel?: string;
|
|
424
|
-
/** secondary CTA click (phone). */
|
|
425
|
-
onCall?: () => void;
|
|
426
|
-
/** open the Finanzierungs-/Leasingdetails popup (full breakdown + legal, expanded). Omit to hide the link. */
|
|
427
|
-
onShowDetails?: () => void;
|
|
428
|
-
/** mobile only: open the "Rate anpassen" / "Details anzeigen" sheet (collapsed/default view).
|
|
429
|
-
* Omit to hide the trigger row (falls back to the desktop inline expander). */
|
|
430
|
-
onOpenAdjust?: () => void;
|
|
431
|
-
/** mode segment changed. */
|
|
432
|
-
onModeChange: (mode: FinanceMode) => void;
|
|
433
|
-
/** down-payment slider changed. */
|
|
434
|
-
onDownChange: (down: number) => void;
|
|
435
|
-
/** term changed. */
|
|
436
|
-
onTermChange: (term: number) => void;
|
|
437
|
-
/** whether leasing is actually offered for this car (financingConfig.leasing.isActive — same
|
|
438
|
-
* age/mileage-gated flag SearchResultsStore.getLeasingActive stamps for the cards, see
|
|
439
|
-
* cardParts.tsx's PriceTabs / toAutobahnCar.ts's `lease`). Default true keeps existing callers'
|
|
440
|
-
* behavior; the VDP page passes the real computed value. Hides the Leasing tab when false,
|
|
441
|
-
* same as the card — instead of showing a tab that would compute/display a rate the car isn't
|
|
442
|
-
* eligible for. */
|
|
443
|
-
leasingAvailable?: boolean;
|
|
444
|
-
/** i18n function (drilled from the page). */
|
|
445
|
-
t: TranslationFunction;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
const eur = (n: number): string => n.toLocaleString('de-DE');
|
|
449
|
-
|
|
450
|
-
/** build a [min..max] step range (fallback term options when none are supplied). */
|
|
451
|
-
const range = (min: number, max: number, step: number): number[] => {
|
|
452
|
-
const out: number[] = [];
|
|
453
|
-
for (let v = min; v <= max; v += step || 12) out.push(v);
|
|
454
|
-
return out.length ? out : [min];
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
/** quiet primary-colored text link (Finanzierungsdetails / Details anzeigen). */
|
|
458
|
-
const DetailsLink: React.FunctionComponent<{ label: string; onClick: () => void }> = ({ label, onClick }) => (
|
|
459
|
-
<button
|
|
460
|
-
type="button"
|
|
461
|
-
onClick={onClick}
|
|
462
|
-
style={{
|
|
463
|
-
display: 'inline-flex',
|
|
464
|
-
alignItems: 'center',
|
|
465
|
-
gap: 5,
|
|
466
|
-
background: 'none',
|
|
467
|
-
border: 0,
|
|
468
|
-
padding: 0,
|
|
469
|
-
cursor: 'pointer',
|
|
470
|
-
color: 'var(--md-primary)',
|
|
471
|
-
font: 'inherit',
|
|
472
|
-
fontSize: 13,
|
|
473
|
-
fontWeight: 600,
|
|
474
|
-
}}
|
|
475
|
-
>
|
|
476
|
-
<Icon name="info" size={15} color="var(--md-primary)" />
|
|
477
|
-
{label}
|
|
478
|
-
</button>
|
|
479
|
-
);
|
|
480
|
-
|
|
481
|
-
/** "Rate anpassen" / "Details anzeigen" expander toggle button. */
|
|
482
|
-
export const expanderBtnStyle: React.CSSProperties = {
|
|
483
|
-
width: '100%',
|
|
484
|
-
background: 'none',
|
|
485
|
-
border: 0,
|
|
486
|
-
cursor: 'pointer',
|
|
487
|
-
display: 'flex',
|
|
488
|
-
alignItems: 'center',
|
|
489
|
-
justifyContent: 'space-between',
|
|
490
|
-
padding: '0 0 2px',
|
|
491
|
-
color: 'var(--md-primary)',
|
|
492
|
-
fontWeight: 600,
|
|
493
|
-
fontSize: 14,
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
|
|
497
|
-
mode,
|
|
498
|
-
price,
|
|
499
|
-
listPrice,
|
|
500
|
-
autoDeId,
|
|
501
|
-
ratingLabel,
|
|
502
|
-
monthly,
|
|
503
|
-
oldMonthly,
|
|
504
|
-
creditKeyFigures,
|
|
505
|
-
leasingKeyFigures,
|
|
506
|
-
down,
|
|
507
|
-
term,
|
|
508
|
-
downMin,
|
|
509
|
-
downMax,
|
|
510
|
-
downStep = 500,
|
|
511
|
-
termMin,
|
|
512
|
-
termMax,
|
|
513
|
-
termStep = 6,
|
|
514
|
-
termOptions,
|
|
515
|
-
annualMileage,
|
|
516
|
-
annualMileageMin = 5000,
|
|
517
|
-
annualMileageMax = 60000,
|
|
518
|
-
annualMileageStep = 5000,
|
|
519
|
-
onAnnualMileageChange,
|
|
520
|
-
withFinalInstallment,
|
|
521
|
-
onToggleFinalInstallment,
|
|
522
|
-
withAddServices,
|
|
523
|
-
addServicesCost,
|
|
524
|
-
addServicesDisabled,
|
|
525
|
-
onToggleAddServices,
|
|
526
|
-
available,
|
|
527
|
-
phone = '0800 40 30 182',
|
|
528
|
-
onSecure,
|
|
529
|
-
secured,
|
|
530
|
-
secureLabel,
|
|
531
|
-
onCall,
|
|
532
|
-
onShowDetails,
|
|
533
|
-
onOpenAdjust,
|
|
534
|
-
onModeChange,
|
|
535
|
-
onDownChange,
|
|
536
|
-
onTermChange,
|
|
537
|
-
leasingAvailable = true,
|
|
538
|
-
t,
|
|
539
|
-
}) => {
|
|
540
|
-
// Pure view state only — whether the adjust/details expander is open.
|
|
541
|
-
const [adjust, setAdjust] = useState(false);
|
|
542
|
-
// whether the "UVP-Rate" footnote popover (fin/leasing) is open — same widget as CarCard's.
|
|
543
|
-
const [uvpTooltipOpen, setUvpTooltipOpen] = useState(false);
|
|
544
|
-
const isCash = mode === 'cash';
|
|
545
|
-
const isLease = mode === 'leasing';
|
|
546
|
-
const terms = termOptions && termOptions.length ? termOptions : range(termMin, termMax, termStep);
|
|
547
|
-
const showStrike = listPrice != null && listPrice > price;
|
|
548
|
-
// price-evaluation tier from the rating label (defaults to 'Guter Preis' tier when unmapped).
|
|
549
|
-
const tierIdx = TIER_LABELS.indexOf(ratingLabel as (typeof TIER_LABELS)[number]);
|
|
550
|
-
const evalTier = tierIdx >= 0 ? tierIdx : 1;
|
|
551
|
-
const isGoodTier = TIER_KEYS[evalTier] === 'good';
|
|
552
|
-
// each tier shows its own real label now (Top/Guter/Fairer/Erhöht/Hoher Preis) — no more
|
|
553
|
-
// collapsing 'good' onto the "Top-Preis" claim. Pill styling (colour/class/footnote) unchanged.
|
|
554
|
-
const evalTierLabel = t('autobahn:tier.' + TIER_KEYS[evalTier]);
|
|
555
|
-
const evalPillColor = isGoodTier ? TIER_COLORS[0] : TIER_COLORS[evalTier];
|
|
556
|
-
// condition summary (current selection) + its own details link — financing: "0 € Anzahlung ·
|
|
557
|
-
// 60 Monate · Finanzierungsdetails"; leasing: "25.000 € Sonderzahlung · 60 Mon. · 10.000
|
|
558
|
-
// km/Jahr · Details" (same wording/order as CarCard's own PriceTerms leaseTerms).
|
|
559
|
-
const condParts: string[] = [];
|
|
560
|
-
if (mode === 'leasing') {
|
|
561
|
-
condParts.push(
|
|
562
|
-
...t('autobahn:card.price.leaseTerms', {
|
|
563
|
-
firstInstallment: eur(down),
|
|
564
|
-
months: term,
|
|
565
|
-
mileage: annualMileage != null ? eur(annualMileage) : '',
|
|
566
|
-
}).split(' · '),
|
|
567
|
-
);
|
|
568
|
-
} else if (!isCash) {
|
|
569
|
-
condParts.push(t('autobahn:finance.downPaymentLabel', { value: eur(down) }));
|
|
570
|
-
condParts.push(t('autobahn:finance.monthsLabel', { months: term, count: term }));
|
|
571
|
-
}
|
|
572
|
-
// ADV-405 follow-up: financing shows the key figures (Kerndaten) in place of the line above —
|
|
573
|
-
// only when at least one figure is real, else the old "0 € Anzahlung · 60 Monate" line stays.
|
|
574
|
-
const tabKeyFigures = mode === 'fin' ? creditKeyFigures : mode === 'leasing' ? leasingKeyFigures : undefined;
|
|
575
|
-
const keyFigures = tabKeyFigures && hasCreditKeyFigures(tabKeyFigures) ? tabKeyFigures : undefined;
|
|
576
|
-
|
|
577
|
-
return (
|
|
578
|
-
<div className="mcard mcard--elevated fin-calc-card" style={{ padding: 20 }}>
|
|
579
|
-
{/* header — desktop only; mobile goes straight into the tabs (see mockup: no card
|
|
580
|
-
title above Finanzierung/Leasing/Kaufen on phone). */}
|
|
581
|
-
<div className="fin-card-header hide-mobile" style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
|
|
582
|
-
<span
|
|
583
|
-
style={{
|
|
584
|
-
width: 34,
|
|
585
|
-
height: 34,
|
|
586
|
-
borderRadius: 'var(--md-r-full)',
|
|
587
|
-
background: 'var(--md-primary-container)',
|
|
588
|
-
display: 'flex',
|
|
589
|
-
alignItems: 'center',
|
|
590
|
-
justifyContent: 'center',
|
|
591
|
-
flex: 'none',
|
|
592
|
-
}}
|
|
593
|
-
>
|
|
594
|
-
<Icon name="tag" size={18} color="var(--md-on-primary-container)" />
|
|
595
|
-
</span>
|
|
596
|
-
<div style={{ fontFamily: 'var(--md-font-display)', fontSize: 18, fontWeight: 700 }}>{t('autobahn:finance.headerTitle')}</div>
|
|
597
|
-
</div>
|
|
598
|
-
|
|
599
|
-
{/* payment-type TABS on top — Leasing omitted when the car isn't leasing-eligible, same
|
|
600
|
-
rule cardParts.tsx's PriceTabs already applies (car.lease != null there). */}
|
|
601
|
-
<div className="fin-tabs" role="tablist">
|
|
602
|
-
{(
|
|
603
|
-
[
|
|
604
|
-
['fin', 'autobahn:finance.mode.financing'],
|
|
605
|
-
...(leasingAvailable ? ([['leasing', 'autobahn:finance.mode.leasing']] as Array<[FinanceMode, string]>) : []),
|
|
606
|
-
['cash', 'autobahn:finance.mode.cash'],
|
|
607
|
-
] as Array<[FinanceMode, string]>
|
|
608
|
-
).map(([k, labelKey]) => (
|
|
609
|
-
<button
|
|
610
|
-
key={k}
|
|
611
|
-
type="button"
|
|
612
|
-
role="tab"
|
|
613
|
-
aria-selected={mode === k}
|
|
614
|
-
className={'fin-tab' + (mode === k ? ' on' : '')}
|
|
615
|
-
onClick={() => onModeChange(k)}
|
|
616
|
-
>
|
|
617
|
-
{k === 'cash' ? (
|
|
618
|
-
<>
|
|
619
|
-
{/* cash tab is "Kaufen" on both phone and desktop now — same key both spans. */}
|
|
620
|
-
<span className="hide-mobile">{t('autobahn:card.price.buy')}</span>
|
|
621
|
-
<span className="show-mobile" style={{ justifyContent: 'center' }}>
|
|
622
|
-
{t('autobahn:card.price.buy')}
|
|
623
|
-
</span>
|
|
624
|
-
</>
|
|
625
|
-
) : (
|
|
626
|
-
t(labelKey)
|
|
627
|
-
)}
|
|
628
|
-
</button>
|
|
629
|
-
))}
|
|
630
|
-
</div>
|
|
631
|
-
|
|
632
|
-
{/* 2-col grid: rate|pill (row 1) + condLine|bar (row 2) — fixed right column prevents wrapping */}
|
|
633
|
-
<div className={'fin-price-grid' + (isCash ? ' fin-price-grid--cash' : '')}>
|
|
634
|
-
{/* col 1 row 1: hero rate — Figma: "329 €" all-big, then a small stacked column with
|
|
635
|
-
the struck old rate ABOVE "/mtl." (round 11; was a single baseline row) */}
|
|
636
|
-
<div className="fin-rate-main">
|
|
637
|
-
{/* mobile Kaufen (Figma round 14): struck list price ABOVE the price, right-aligned,
|
|
638
|
-
tight to the figure — replaces the Festpreis + UVP lines, which stay desktop-only */}
|
|
639
|
-
{isCash && showStrike && (
|
|
640
|
-
<div
|
|
641
|
-
className="show-mobile"
|
|
642
|
-
style={{ justifyContent: 'flex-end', alignItems: 'baseline', gap: 4, lineHeight: 1, marginTop: 7 }}
|
|
643
|
-
role="button"
|
|
644
|
-
tabIndex={0}
|
|
645
|
-
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
646
|
-
>
|
|
647
|
-
{/* ADV-423: same size as the struck price next to it (md3.css .pp-uvp-label) */}
|
|
648
|
-
<span
|
|
649
|
-
className={`pp-uvp-label${
|
|
650
|
-
String(Math.round(listPrice as number)).length === 5
|
|
651
|
-
? ' pp-uvp-label--len5'
|
|
652
|
-
: String(Math.round(listPrice as number)).length === 4
|
|
653
|
-
? ' pp-uvp-label--len4'
|
|
654
|
-
: ''
|
|
655
|
-
}`}
|
|
656
|
-
>
|
|
657
|
-
{t('autobahn:finance.uvp')}
|
|
658
|
-
</span>
|
|
659
|
-
<span
|
|
660
|
-
className={`num pp-hero-old${
|
|
661
|
-
String(Math.round(listPrice as number)).length === 5
|
|
662
|
-
? ' pp-hero-old--len5'
|
|
663
|
-
: String(Math.round(listPrice as number)).length === 4
|
|
664
|
-
? ' pp-hero-old--len4'
|
|
665
|
-
: ''
|
|
666
|
-
}`}
|
|
667
|
-
>
|
|
668
|
-
{eur(Math.round(listPrice as number))} €
|
|
669
|
-
<span
|
|
670
|
-
className="pp-eyebrow-badge"
|
|
671
|
-
role="button"
|
|
672
|
-
tabIndex={0}
|
|
673
|
-
onClick={(e) => {
|
|
674
|
-
e.stopPropagation();
|
|
675
|
-
setUvpTooltipOpen((v) => !v);
|
|
676
|
-
}}
|
|
677
|
-
>
|
|
678
|
-
2
|
|
679
|
-
</span>
|
|
680
|
-
{uvpTooltipOpen && (
|
|
681
|
-
<div className="pp-uvp-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
682
|
-
<button
|
|
683
|
-
type="button"
|
|
684
|
-
className="pp-uvp-tooltip-close"
|
|
685
|
-
aria-label={t('autobahn:modal.close')}
|
|
686
|
-
onClick={(e) => {
|
|
687
|
-
e.stopPropagation();
|
|
688
|
-
setUvpTooltipOpen(false);
|
|
689
|
-
}}
|
|
690
|
-
>
|
|
691
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
692
|
-
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
693
|
-
</svg>
|
|
694
|
-
</button>
|
|
695
|
-
<div className="pp-uvp-tooltip-body">{t('autobahn:card.price.uvpListTooltipBody')}</div>
|
|
696
|
-
</div>
|
|
697
|
-
)}
|
|
698
|
-
</span>
|
|
699
|
-
</div>
|
|
700
|
-
)}
|
|
701
|
-
{/* desktop: same struck list price ABOVE the rate, same fin-rate-old-list styling +
|
|
702
|
-
clickable UVP badge/tooltip as the mobile sheet's own Kaufen block.
|
|
703
|
-
Wrapper now renders on EVERY Kaufen car (isCash alone, not isCash && showStrike) —
|
|
704
|
-
cross-tab height parity (md3.css) reserves this row's height once, assuming it's
|
|
705
|
-
always there; a car with no discount used to skip it entirely, landing .fin-rate-main
|
|
706
|
-
(and the whole card) ~20px shorter than a discounted one and breaking that parity.
|
|
707
|
-
fin-rate-strike-slot (md3.css) gives it a fixed height so the slot itself doesn't
|
|
708
|
-
move even though the <s> price inside is still conditional on showStrike. */}
|
|
709
|
-
{isCash && (
|
|
710
|
-
<div
|
|
711
|
-
className="hide-mobile fin-rate-strike-slot"
|
|
712
|
-
style={{
|
|
713
|
-
display: 'flex',
|
|
714
|
-
justifyContent: 'flex-end',
|
|
715
|
-
alignItems: 'baseline',
|
|
716
|
-
lineHeight: 1,
|
|
717
|
-
marginTop: 0,
|
|
718
|
-
cursor: showStrike ? 'pointer' : 'default',
|
|
719
|
-
}}
|
|
720
|
-
role="button"
|
|
721
|
-
tabIndex={0}
|
|
722
|
-
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
723
|
-
>
|
|
724
|
-
{/* ADV-423: "UVP" label right before the struck list price (this slot is desktop-only) */}
|
|
725
|
-
{showStrike && <span className="pp-uvp-label">{t('autobahn:finance.uvp')}</span>}
|
|
726
|
-
{showStrike && (
|
|
727
|
-
<s className="num fin-rate-old fin-rate-old-list">
|
|
728
|
-
{eur(listPrice as number)} €
|
|
729
|
-
<span
|
|
730
|
-
className="pp-eyebrow-badge"
|
|
731
|
-
role="button"
|
|
732
|
-
tabIndex={0}
|
|
733
|
-
onClick={(e) => {
|
|
734
|
-
e.stopPropagation();
|
|
735
|
-
setUvpTooltipOpen((v) => !v);
|
|
736
|
-
}}
|
|
737
|
-
>
|
|
738
|
-
2
|
|
739
|
-
</span>
|
|
740
|
-
{uvpTooltipOpen && (
|
|
741
|
-
<div className="pp-uvp-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
742
|
-
<button
|
|
743
|
-
type="button"
|
|
744
|
-
className="pp-uvp-tooltip-close"
|
|
745
|
-
aria-label={t('autobahn:modal.close')}
|
|
746
|
-
onClick={(e) => {
|
|
747
|
-
e.stopPropagation();
|
|
748
|
-
setUvpTooltipOpen(false);
|
|
749
|
-
}}
|
|
750
|
-
>
|
|
751
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
752
|
-
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
753
|
-
</svg>
|
|
754
|
-
</button>
|
|
755
|
-
<div className="pp-uvp-tooltip-body">{t('autobahn:card.price.uvpListTooltipBody')}</div>
|
|
756
|
-
</div>
|
|
757
|
-
)}
|
|
758
|
-
</s>
|
|
759
|
-
)}
|
|
760
|
-
</div>
|
|
761
|
-
)}
|
|
762
|
-
<div style={{ display: 'flex', alignItems: 'center', gap: 7 }}>
|
|
763
|
-
{isCash ? (
|
|
764
|
-
<>
|
|
765
|
-
{/* phone: ONE unbreakable "13.249 €" span (a separate € span wraps to its own
|
|
766
|
-
line); desktop keeps the number + quiet small € pair */}
|
|
767
|
-
<span
|
|
768
|
-
className={`num show-mobile fin-rate-cash-mobile${
|
|
769
|
-
(() => {
|
|
770
|
-
const digits = String(Math.round(price as number)).length;
|
|
771
|
-
if (digits >= 8) return ' fin-rate-cash-mobile--len8';
|
|
772
|
-
if (digits === 7) return ' fin-rate-cash-mobile--len7';
|
|
773
|
-
if (digits === 6) return ' fin-rate-cash-mobile--len6';
|
|
774
|
-
return '';
|
|
775
|
-
})()
|
|
776
|
-
}`}
|
|
777
|
-
style={{ fontSize: 48, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px', whiteSpace: 'nowrap' }}
|
|
778
|
-
>
|
|
779
|
-
{eur(price)} €<sup>1</sup>
|
|
780
|
-
</span>
|
|
781
|
-
<span
|
|
782
|
-
className="num hide-mobile"
|
|
783
|
-
style={{ fontSize: 45, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px' }}
|
|
784
|
-
>
|
|
785
|
-
{eur(price)} €<sup>1</sup>
|
|
786
|
-
</span>
|
|
787
|
-
</>
|
|
788
|
-
) : (
|
|
789
|
-
<>
|
|
790
|
-
<span
|
|
791
|
-
className={`num fin-rate-hero${
|
|
792
|
-
(() => {
|
|
793
|
-
const digits = String(Math.round(monthly)).length;
|
|
794
|
-
if (digits >= 6) return ' fin-rate-hero--len6';
|
|
795
|
-
if (digits === 5) return ' fin-rate-hero--len5';
|
|
796
|
-
if (digits === 4) return ' fin-rate-hero--len4';
|
|
797
|
-
return '';
|
|
798
|
-
})()
|
|
799
|
-
}`}
|
|
800
|
-
style={{ fontSize: 48, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px' }}
|
|
801
|
-
>
|
|
802
|
-
{eur(Math.round(monthly))}<span style={{ marginLeft: 6 }}>€</span>
|
|
803
|
-
</span>
|
|
804
|
-
<span className="fin-rate-unit">
|
|
805
|
-
{/* struck old rate (REAL oldMonthlyInstallment; SRP strikes the same source) */}
|
|
806
|
-
{oldMonthly != null && (
|
|
807
|
-
<span
|
|
808
|
-
style={{ display: 'flex', flexDirection: 'column', cursor: 'pointer' }}
|
|
809
|
-
role="button"
|
|
810
|
-
tabIndex={0}
|
|
811
|
-
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
812
|
-
>
|
|
813
|
-
<span className="pp-eyebrow">
|
|
814
|
-
{t('autobahn:card.price.uvpRateLabel')}
|
|
815
|
-
<span
|
|
816
|
-
className="pp-eyebrow-badge"
|
|
817
|
-
role="button"
|
|
818
|
-
tabIndex={0}
|
|
819
|
-
onClick={(e) => {
|
|
820
|
-
e.stopPropagation();
|
|
821
|
-
setUvpTooltipOpen((v) => !v);
|
|
822
|
-
}}
|
|
823
|
-
>
|
|
824
|
-
3
|
|
825
|
-
</span>
|
|
826
|
-
{uvpTooltipOpen && (
|
|
827
|
-
<div
|
|
828
|
-
className={'pp-uvp-tooltip' + (mode === 'leasing' ? ' pp-uvp-tooltip--leasing' : '')}
|
|
829
|
-
onClick={(e) => e.stopPropagation()}
|
|
830
|
-
>
|
|
831
|
-
<button
|
|
832
|
-
type="button"
|
|
833
|
-
className="pp-uvp-tooltip-close"
|
|
834
|
-
aria-label={t('autobahn:modal.close')}
|
|
835
|
-
onClick={(e) => {
|
|
836
|
-
e.stopPropagation();
|
|
837
|
-
setUvpTooltipOpen(false);
|
|
838
|
-
}}
|
|
839
|
-
>
|
|
840
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
841
|
-
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
842
|
-
</svg>
|
|
843
|
-
</button>
|
|
844
|
-
<div className="pp-uvp-tooltip-body">
|
|
845
|
-
{t(
|
|
846
|
-
mode === 'leasing'
|
|
847
|
-
? 'autobahn:card.price.uvpRateTooltipBodyLeasing'
|
|
848
|
-
: 'autobahn:card.price.uvpRateTooltipBody',
|
|
849
|
-
)}
|
|
850
|
-
</div>
|
|
851
|
-
</div>
|
|
852
|
-
)}
|
|
853
|
-
</span>
|
|
854
|
-
<s
|
|
855
|
-
className={`num fin-rate-old fin-rate-example-price${
|
|
856
|
-
String(Math.round(oldMonthly)).length >= 5
|
|
857
|
-
? ' fin-rate-example-price--len5'
|
|
858
|
-
: String(Math.round(oldMonthly)).length === 4
|
|
859
|
-
? ' fin-rate-example-price--len4'
|
|
860
|
-
: ''
|
|
861
|
-
}`}
|
|
862
|
-
>
|
|
863
|
-
{eur(Math.round(oldMonthly))} €
|
|
864
|
-
</s>
|
|
865
|
-
</span>
|
|
866
|
-
)}
|
|
867
|
-
{/* no struck old rate above it (strike hidden) — nudge "/mtl." down so it
|
|
868
|
-
sits level with the blue hero rate instead of centering high in the row. */}
|
|
869
|
-
<span
|
|
870
|
-
className="fin-rate-example-suffix"
|
|
871
|
-
style={oldMonthly == null ? { paddingTop: 20 } : undefined}
|
|
872
|
-
>
|
|
873
|
-
{t('autobahn:finance.perMonth')}
|
|
874
|
-
</span>
|
|
875
|
-
</span>
|
|
876
|
-
</>
|
|
877
|
-
)}
|
|
878
|
-
</div>
|
|
879
|
-
{isCash && <div className="md-label-sm hide-mobile">{t('autobahn:finance.fixedPrice')}</div>}
|
|
880
|
-
</div>
|
|
881
|
-
{/* col 2: pill + eval bar grouped together (display:contents on desktop — no-op,
|
|
882
|
-
preserves the original rate|pill / cond|bar auto-placement; mobile turns this into
|
|
883
|
-
a real flex column so the two stack tight with a fixed 16px gap). */}
|
|
884
|
-
<div className="fin-eval-col">
|
|
885
|
-
{/* col 2 row 1: price-rating pill (Figma: bold colored label, NO icon) */}
|
|
886
|
-
<div className="fin-eval-pill-cell">
|
|
887
|
-
{ratingLabel && (
|
|
888
|
-
<span
|
|
889
|
-
className={`fin-eval-pill${isGoodTier ? ' fin-eval-pill--good' : ''}`}
|
|
890
|
-
style={{ color: evalPillColor, background: `color-mix(in srgb, ${evalPillColor} 16%, transparent)` }}
|
|
891
|
-
aria-label={t('autobahn:finance.priceRatingAria', { rating: evalTierLabel })}
|
|
892
|
-
>
|
|
893
|
-
{evalTierLabel}
|
|
894
|
-
{isGoodTier && <sup>4</sup>}
|
|
895
|
-
</span>
|
|
896
|
-
)}
|
|
897
|
-
</div>
|
|
898
|
-
{/* segmented evaluation bar (Figma: discrete tiers, not a gradient) */}
|
|
899
|
-
<div className="fin-eval-bar-cell">{ratingLabel && <EvalBar tier={evalTier} />}</div>
|
|
900
|
-
</div>
|
|
901
|
-
{/* col 1 row 2: condition line — financing "0 € Anzahlung · 60 Monate · Finanzierungsdetails",
|
|
902
|
-
leasing "25.000 € Sonderzahlung · 60 Mon. · 10.000 km/Jahr · Details". Buy has nothing
|
|
903
|
-
to show here (no down payment/term/details link of its own) — not rendered at all
|
|
904
|
-
rather than left as an empty reserved-height div.
|
|
905
|
-
ADV-405 follow-up: financing with real key figures → the Kerndaten (2 lines, same
|
|
906
|
-
.fin-cond grid cell/size/colour, wraps where narrow) ending with the same details link. */}
|
|
907
|
-
{keyFigures ? (
|
|
908
|
-
<CreditKeyFigures
|
|
909
|
-
t={t}
|
|
910
|
-
figures={keyFigures}
|
|
911
|
-
cls="fin-cond fin-ckf"
|
|
912
|
-
details={
|
|
913
|
-
onShowDetails && (
|
|
914
|
-
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
915
|
-
{mode === 'leasing' ? t('autobahn:card.price.detailsLink') : t('autobahn:finance.financingDetails')}
|
|
916
|
-
</button>
|
|
917
|
-
)
|
|
918
|
-
}
|
|
919
|
-
/>
|
|
920
|
-
) : !isCash && (
|
|
921
|
-
<div className="fin-cond">
|
|
922
|
-
{condParts.map((part, i) => (
|
|
923
|
-
<React.Fragment key={i}>
|
|
924
|
-
{i > 0 && <span className="cc-terms-dot"> · </span>}
|
|
925
|
-
{part}
|
|
926
|
-
</React.Fragment>
|
|
927
|
-
))}
|
|
928
|
-
{onShowDetails && (
|
|
929
|
-
<>
|
|
930
|
-
<span className="cc-terms-dot"> · </span>
|
|
931
|
-
{/* plain underlined text link, same onShowDetails handler as .fin-info used to open. */}
|
|
932
|
-
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
933
|
-
{mode === 'leasing' ? t('autobahn:card.price.detailsLink') : t('autobahn:finance.financingDetails')}
|
|
934
|
-
</button>
|
|
935
|
-
</>
|
|
936
|
-
)}
|
|
937
|
-
</div>
|
|
938
|
-
)}
|
|
939
|
-
</div>
|
|
940
|
-
|
|
941
|
-
{/* ADV-405/406 Kreditkosten-Hinweis — Preis-Card (mobile) + „Dein Angebot“ (desktop): below the
|
|
942
|
-
conditions line, above „Angebot anfragen“/„Anrufen“ (mobile) or „Rate anpassen“ (desktop).
|
|
943
|
-
Not on Kaufen (no reserved space — the Kaufen view stays exactly as before). */}
|
|
944
|
-
{!isCash && <CreditCostNotice t={t} cls="fin-ccn" />}
|
|
945
|
-
|
|
946
|
-
{/* ============================== DESKTOP (≥601px) — unchanged ============================== */}
|
|
947
|
-
<div className="hide-mobile">
|
|
948
|
-
{/* RATE EDIT (Rate anpassen) — between the rate and the request CTA. fin-adjust--cash:
|
|
949
|
-
Kaufen-only margin-top override (0, was the shared 14px) — see md3.css. */}
|
|
950
|
-
<div className={'fin-adjust' + (isCash ? ' fin-adjust--cash' : '')}>
|
|
951
|
-
<button onClick={() => setAdjust((a) => !a)} style={expanderBtnStyle}>
|
|
952
|
-
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 7 }}>
|
|
953
|
-
<Icon name={isCash ? 'list' : 'sliders-horizontal'} size={16} color="var(--md-primary)" />
|
|
954
|
-
{isCash ? t('autobahn:finance.detailsShow') : t('autobahn:finance.adjustRate')}
|
|
955
|
-
</span>
|
|
956
|
-
<Icon name={adjust ? 'chevron-up' : 'chevron-down'} size={18} color="var(--md-primary)" />
|
|
957
|
-
</button>
|
|
958
|
-
{adjust &&
|
|
959
|
-
(isCash ? (
|
|
960
|
-
<>
|
|
961
|
-
<div style={{ marginTop: 4 }}>
|
|
962
|
-
<CalcRow label={t('autobahn:finance.paymentLabel')} last={!available && !(addServicesCost != null && onToggleAddServices)}>{t('autobahn:finance.paymentValue')}</CalcRow>
|
|
963
|
-
{available && (
|
|
964
|
-
<CalcRow label={t('autobahn:finance.availabilityLabel')} last={!(addServicesCost != null && onToggleAddServices)}>
|
|
965
|
-
{t('autobahn:finance.availabilityValue')}
|
|
966
|
-
</CalcRow>
|
|
967
|
-
)}
|
|
968
|
-
</div>
|
|
969
|
-
{addServicesCost != null && onToggleAddServices && (
|
|
970
|
-
<ToggleRow
|
|
971
|
-
className="fin-toggle-addservices fin-toggle-addservices--cash"
|
|
972
|
-
label={t('autobahn:finance.addServicesToggle')}
|
|
973
|
-
price={t('autobahn:finance.addServicesOnce', { value: eur(Math.round(addServicesCost)) })}
|
|
974
|
-
checked={!!withAddServices}
|
|
975
|
-
disabled={addServicesDisabled}
|
|
976
|
-
onChange={onToggleAddServices}
|
|
977
|
-
staticNote={t('autobahn:finance.addServicesIncluded')}
|
|
978
|
-
tooltip={<AddServicesTooltipBody t={t} isCash />}
|
|
979
|
-
tooltipCloseLabel={t('autobahn:modal.close')}
|
|
980
|
-
t={t}
|
|
981
|
-
/>
|
|
982
|
-
)}
|
|
983
|
-
</>
|
|
984
|
-
) : (
|
|
985
|
-
<div style={{ display: 'flex', flexDirection: 'column', marginTop: 8 }}>
|
|
986
|
-
<div style={{ marginBottom: 15 }}>
|
|
987
|
-
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 6 }}>
|
|
988
|
-
<span className="md-title-sm">{t('autobahn:finance.downPaymentSliderLabel')}</span>
|
|
989
|
-
<span className="num" style={{ fontWeight: 700 }}>
|
|
990
|
-
{eur(down)} €
|
|
991
|
-
</span>
|
|
992
|
-
</div>
|
|
993
|
-
<Slider
|
|
994
|
-
min={downMin}
|
|
995
|
-
max={downMax}
|
|
996
|
-
step={downStep}
|
|
997
|
-
value={down}
|
|
998
|
-
onChange={onDownChange}
|
|
999
|
-
fmt={(v) => `${eur(Number(v))} €`}
|
|
1000
|
-
/>
|
|
1001
|
-
</div>
|
|
1002
|
-
{annualMileage != null && onAnnualMileageChange && (
|
|
1003
|
-
<div style={{ marginBottom: 15 }}>
|
|
1004
|
-
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 6 }}>
|
|
1005
|
-
<span className="md-title-sm">{t('autobahn:finance.annualMileageLabel')}</span>
|
|
1006
|
-
<span className="num" style={{ fontWeight: 700 }}>
|
|
1007
|
-
{eur(annualMileage)} km
|
|
1008
|
-
</span>
|
|
1009
|
-
</div>
|
|
1010
|
-
<Slider
|
|
1011
|
-
min={annualMileageMin}
|
|
1012
|
-
max={annualMileageMax}
|
|
1013
|
-
step={annualMileageStep}
|
|
1014
|
-
value={annualMileage}
|
|
1015
|
-
onChange={onAnnualMileageChange}
|
|
1016
|
-
fmt={(v) => `${eur(Number(v))} km`}
|
|
1017
|
-
/>
|
|
1018
|
-
</div>
|
|
1019
|
-
)}
|
|
1020
|
-
<div style={{ marginBottom: 15 }}>
|
|
1021
|
-
<div className="md-title-sm" style={{ marginBottom: 8 }}>
|
|
1022
|
-
{t('autobahn:finance.termSelection')}
|
|
1023
|
-
</div>
|
|
1024
|
-
<TermChips options={terms.filter((v) => v !== 12 && v !== 96)} value={term} onChange={onTermChange} t={t} />
|
|
1025
|
-
</div>
|
|
1026
|
-
{/* same Mit-Schlussrate / Rundum-Sorglos-Paket toggles as the mobile sheet / modal
|
|
1027
|
-
desktop block — replaces the static Kaufpreis/Garantie/Lieferung rows. */}
|
|
1028
|
-
{!isLease && onToggleFinalInstallment && (
|
|
1029
|
-
<ToggleRow
|
|
1030
|
-
className="fin-toggle-final"
|
|
1031
|
-
label={t('autobahn:finance.finalInstallmentToggle')}
|
|
1032
|
-
checked={!!withFinalInstallment}
|
|
1033
|
-
onChange={onToggleFinalInstallment}
|
|
1034
|
-
/>
|
|
1035
|
-
)}
|
|
1036
|
-
{addServicesCost != null && onToggleAddServices && (
|
|
1037
|
-
<ToggleRow
|
|
1038
|
-
className={'fin-toggle-addservices' + (isLease ? ' fin-toggle-addservices--leasing' : '')}
|
|
1039
|
-
label={t('autobahn:finance.addServicesToggle')}
|
|
1040
|
-
price={t('autobahn:finance.addServicesPerMonth', { value: eur(Math.round(addServicesCost)) })}
|
|
1041
|
-
checked={!!withAddServices}
|
|
1042
|
-
disabled={addServicesDisabled}
|
|
1043
|
-
onChange={onToggleAddServices}
|
|
1044
|
-
tooltip={<AddServicesTooltipBody t={t} isLease={isLease} />}
|
|
1045
|
-
tooltipCloseLabel={t('autobahn:modal.close')}
|
|
1046
|
-
t={t}
|
|
1047
|
-
/>
|
|
1048
|
-
)}
|
|
1049
|
-
</div>
|
|
1050
|
-
))}
|
|
1051
|
-
</div>
|
|
1052
|
-
|
|
1053
|
-
{/* REQUEST CTA */}
|
|
1054
|
-
<Button
|
|
1055
|
-
variant="filled"
|
|
1056
|
-
block
|
|
1057
|
-
size="lg"
|
|
1058
|
-
icon="shield-check"
|
|
1059
|
-
className={secured ? 'fin-cta-secured' : undefined}
|
|
1060
|
-
style={{ marginTop: 14 }}
|
|
1061
|
-
onClick={onSecure}
|
|
1062
|
-
>
|
|
1063
|
-
{secured && secureLabel ? secureLabel : t('autobahn:finance.secureOffer')}
|
|
1064
|
-
</Button>
|
|
1065
|
-
{/* phone CTA — touch only (hidden on desktop via .fin-call) */}
|
|
1066
|
-
<div className="fin-call">
|
|
1067
|
-
<Button variant="outlined" block icon="phone" onClick={onCall}>
|
|
1068
|
-
{phone}
|
|
1069
|
-
</Button>
|
|
1070
|
-
</div>
|
|
1071
|
-
|
|
1072
|
-
{/* auto.de-ID in front of the Finanzierungs-/Leasingdetails link — one row, under everything */}
|
|
1073
|
-
{(autoDeId || (!isCash && onShowDetails)) && (
|
|
1074
|
-
<div className="fin-info">
|
|
1075
|
-
{autoDeId && <span className="fin-id">auto.de-ID {autoDeId}</span>}
|
|
1076
|
-
{!isCash && onShowDetails && (
|
|
1077
|
-
<DetailsLink
|
|
1078
|
-
label={mode === 'leasing' ? t('autobahn:finance.leasingDetails') : t('autobahn:finance.financingDetails')}
|
|
1079
|
-
onClick={onShowDetails}
|
|
1080
|
-
/>
|
|
1081
|
-
)}
|
|
1082
|
-
</div>
|
|
1083
|
-
)}
|
|
1084
|
-
</div>
|
|
1085
|
-
|
|
1086
|
-
{/* ============================== MOBILE (≤600px) — new layout ============================== */}
|
|
1087
|
-
<div className="show-mobile" style={{ flexDirection: 'column' }}>
|
|
1088
|
-
{/* side-by-side CTAs — mockup ratio ~2:1, with the tiny auto.de-ID sitting
|
|
1089
|
-
directly under the Anrufen button (not in its own full-width row). */}
|
|
1090
|
-
<div className="fin-cta-row" style={{ display: 'flex', gap: 10, alignItems: 'flex-start' }}>
|
|
1091
|
-
{/* Figma CTA icon: document + check badge (composed — no single lucide glyph) */}
|
|
1092
|
-
<Button
|
|
1093
|
-
variant="filled"
|
|
1094
|
-
size="lg"
|
|
1095
|
-
className={secured ? 'fin-cta-secured' : undefined}
|
|
1096
|
-
style={{ width: 216, height: 50, paddingLeft: 0, paddingRight: 9, gap: secured ? 3 : 18 }}
|
|
1097
|
-
onClick={onSecure}
|
|
1098
|
-
>
|
|
1099
|
-
{/* size 23 either way — was 18 for the secured (shield-check) state, notably
|
|
1100
|
-
smaller than DocCheckIcon's 23 in the default state despite sharing the exact
|
|
1101
|
-
same 50px button box; nothing about switching to "already secured" should
|
|
1102
|
-
shrink the icon. */}
|
|
1103
|
-
{secured ? <Icon name="shield-check" size={23} /> : <DocCheckIcon size={23} />}
|
|
1104
|
-
{secured && secureLabel ? secureLabel : t('autobahn:finance.secureOffer')}
|
|
1105
|
-
</Button>
|
|
1106
|
-
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 4, minWidth: 0 }}>
|
|
1107
|
-
<Button variant="outlined" size="lg" icon="phone" style={{ width: 112, height: 50 }} onClick={onCall}>
|
|
1108
|
-
{t('autobahn:finance.callCta')}
|
|
1109
|
-
</Button>
|
|
1110
|
-
{autoDeId && (
|
|
1111
|
-
<span
|
|
1112
|
-
className="num"
|
|
1113
|
-
style={{ fontSize: 10, fontWeight: 700, color: 'var(--md-primary)', textAlign: 'center', whiteSpace: 'nowrap' }}
|
|
1114
|
-
>
|
|
1115
|
-
auto.de ID: {autoDeId}
|
|
1116
|
-
</span>
|
|
1117
|
-
)}
|
|
1118
|
-
</div>
|
|
1119
|
-
</div>
|
|
1120
|
-
|
|
1121
|
-
{/* Persönliche Beratung — icon + one line (the details link now lives in .fin-cond above) */}
|
|
1122
|
-
<div className="fin-info" style={{ justifyContent: 'flex-start', paddingLeft: 15 }}>
|
|
1123
|
-
<Icon name="user" size={26} color="var(--md-on-surface-variant)" style={{ flex: 'none', marginRight: 20 }} />
|
|
1124
|
-
<span className="fin-info-line">{t('autobahn:finance.personalConsultationLine')}</span>
|
|
1125
|
-
</div>
|
|
1126
|
-
|
|
1127
|
-
{/* "Rate anpassen" / "Details anzeigen" — opens the full bottom sheet (not an inline expander) */}
|
|
1128
|
-
{onOpenAdjust && (
|
|
1129
|
-
<button
|
|
1130
|
-
type="button"
|
|
1131
|
-
onClick={onOpenAdjust}
|
|
1132
|
-
style={{ ...expanderBtnStyle, borderTop: '1px solid var(--md-outline-variant)', marginTop: 11, padding: '11px 0 2px 21px' }}
|
|
1133
|
-
>
|
|
1134
|
-
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 21 }}>
|
|
1135
|
-
<Icon name="sliders-horizontal" size={23} color="var(--md-primary)" />
|
|
1136
|
-
<span className="fin-adjust-btn-label">
|
|
1137
|
-
{isCash ? t('autobahn:finance.detailsShow') : t('autobahn:finance.adjustRate')}
|
|
1138
|
-
</span>
|
|
1139
|
-
</span>
|
|
1140
|
-
<Icon name="chevron-right" size={23} color="var(--md-primary)" />
|
|
1141
|
-
</button>
|
|
1142
|
-
)}
|
|
1143
|
-
</div>
|
|
1144
|
-
</div>
|
|
1145
|
-
);
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
export default FinanceCalculator;
|
|
1
|
+
// Autobahn (auto.de redesign) — VDP offer / finance card (Finanzierung / Leasing /
|
|
2
|
+
// Barzahlung).
|
|
3
|
+
//
|
|
4
|
+
// Structure (desktop rethink, tabs-on-top): payment-type TABS at the top (MD3 underline tabs),
|
|
5
|
+
// then the rate (with any discount), then the "Rate anpassen" rate-editor, then the primary
|
|
6
|
+
// "Angebot sichern" request CTA, and finally the Finanzierungs-/Leasingdetails info + popup link
|
|
7
|
+
// at the foot. Laufzeit is chosen via chips (discrete terms), not a slider.
|
|
8
|
+
//
|
|
9
|
+
// CONTROLLED / PRESENTATIONAL — computes NOTHING financial: `mode`, `monthly`, `down`, `term` and
|
|
10
|
+
// the slider/chip bounds all arrive as props; segment/slider/chip changes are reported back via
|
|
11
|
+
// `onModeChange` / `onDownChange` / `onTermChange`. The real numbers come from `financingStore`.
|
|
12
|
+
// The only local state is the `adjust` expander (pure view state).
|
|
13
|
+
//
|
|
14
|
+
// Renders correctly only inside a `<div className="md3">` subtree.
|
|
15
|
+
|
|
16
|
+
import React, { useState, useEffect } from 'react';
|
|
17
|
+
import { TranslationFunction } from '../types';
|
|
18
|
+
|
|
19
|
+
import { Button, Icon, Switch, CreditCostNotice, CreditKeyFigures, hasCreditKeyFigures } from '../ui';
|
|
20
|
+
import type { CreditKeyFiguresData } from '../ui';
|
|
21
|
+
import { TIER_LABELS, TIER_KEYS, TIER_COLORS } from '../constants';
|
|
22
|
+
|
|
23
|
+
/** Payment mode segment keys. Mirrors the design's ['fin','leasing','cash']. */
|
|
24
|
+
export type FinanceMode = 'fin' | 'leasing' | 'cash';
|
|
25
|
+
|
|
26
|
+
export interface SliderProps {
|
|
27
|
+
min: number;
|
|
28
|
+
max: number;
|
|
29
|
+
step?: number;
|
|
30
|
+
value: number;
|
|
31
|
+
onChange: (value: number) => void;
|
|
32
|
+
/** formats the min/max end labels (and is reused by callers for the value). */
|
|
33
|
+
fmt?: (v: number) => React.ReactNode;
|
|
34
|
+
/** render the current value in a floating bubble above the thumb (Figma sheet sliders). */
|
|
35
|
+
bubble?: boolean;
|
|
36
|
+
/** space reserved below the rail for the bubble's tail (Figma differs per sheet: fin vs leasing). */
|
|
37
|
+
bubblePaddingBottom?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Range slider with a filled track and min/max end labels. The track fill is a
|
|
42
|
+
* linear-gradient driven by the value's position; the design's `.mslider` class
|
|
43
|
+
* styles the thumb/rail. With `bubble` the current value floats above the thumb
|
|
44
|
+
* (mockup "Rate anpassen" sliders) instead of the caller printing it elsewhere.
|
|
45
|
+
*/
|
|
46
|
+
export const Slider: React.FunctionComponent<SliderProps> = ({
|
|
47
|
+
min,
|
|
48
|
+
max,
|
|
49
|
+
step = 1,
|
|
50
|
+
value,
|
|
51
|
+
onChange,
|
|
52
|
+
fmt = (v) => v,
|
|
53
|
+
bubble,
|
|
54
|
+
bubblePaddingBottom = 34,
|
|
55
|
+
}) => {
|
|
56
|
+
// Local mirror of `value`, updated INSTANTLY on every native input event. Callers commonly
|
|
57
|
+
// debounce their own onChange (e.g. CheckoutFinancePanelNext's 50ms setCommonUserConfig,
|
|
58
|
+
// which also triggers a MobX-driven re-render of a much bigger subtree) — without this, the
|
|
59
|
+
// thumb still drags natively/smoothly (the browser owns that), but the gradient fill and any
|
|
60
|
+
// bubble label are driven by the `value` PROP, which only catches up once the debounced commit
|
|
61
|
+
// finally lands, so the fill visibly lags/stutters behind the thumb during a fast drag. Synced
|
|
62
|
+
// back to the prop via useEffect for externally-driven changes (e.g. a reset button).
|
|
63
|
+
const [localValue, setLocalValue] = useState(value);
|
|
64
|
+
useEffect(() => { setLocalValue(value); }, [value]);
|
|
65
|
+
|
|
66
|
+
const span = max - min;
|
|
67
|
+
const pct = span > 0 ? ((localValue - min) / span) * 100 : 0;
|
|
68
|
+
return (
|
|
69
|
+
<div>
|
|
70
|
+
<div style={{ position: 'relative', paddingTop: bubble ? 44 : 0, paddingBottom: bubble ? bubblePaddingBottom : 0 }}>
|
|
71
|
+
{bubble && (
|
|
72
|
+
// thumb is 22px wide: interpolate the bubble anchor between half-thumb insets so it
|
|
73
|
+
// tracks the thumb center (a plain pct% drifts at the rail ends)
|
|
74
|
+
<span className="slider-bubble num" style={{ left: `calc(11px + (100% - 22px) * ${pct / 100})` }}>
|
|
75
|
+
{fmt(localValue)}
|
|
76
|
+
</span>
|
|
77
|
+
)}
|
|
78
|
+
<input
|
|
79
|
+
type="range"
|
|
80
|
+
className="mslider"
|
|
81
|
+
min={min}
|
|
82
|
+
max={max}
|
|
83
|
+
step={step}
|
|
84
|
+
value={localValue}
|
|
85
|
+
onChange={(e) => {
|
|
86
|
+
const v = Number(e.target.value);
|
|
87
|
+
setLocalValue(v);
|
|
88
|
+
onChange(v);
|
|
89
|
+
}}
|
|
90
|
+
style={{ background: `linear-gradient(90deg, var(--md-primary) ${pct}%, var(--md-sc-highest) ${pct}%)` }}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
{!bubble && (
|
|
94
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 4 }}>
|
|
95
|
+
<span className="md-label-sm">{fmt(min)}</span>
|
|
96
|
+
<span className="md-label-sm">{fmt(max)}</span>
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Segmented price-evaluation bar (Figma: 5 discrete tier segments, NOT a gradient) with a
|
|
105
|
+
* white ring marker. `leftPct` overrides the marker position (the Marktwert gauge positions
|
|
106
|
+
* it continuously); default = centered on the tier segment.
|
|
107
|
+
*/
|
|
108
|
+
export const EvalBar: React.FunctionComponent<{ tier: number; leftPct?: number }> = ({ tier, leftPct }) => (
|
|
109
|
+
<div className="fin-eval-bar">
|
|
110
|
+
{TIER_COLORS.map((c, i) => (
|
|
111
|
+
<span key={i} className="fin-eval-seg" style={{ background: c }} />
|
|
112
|
+
))}
|
|
113
|
+
<div
|
|
114
|
+
className={`fin-eval-thumb${TIER_KEYS[Math.max(0, Math.min(4, tier))] === 'good' ? ' fin-eval-thumb--good' : ''}`}
|
|
115
|
+
style={{ left: `${leftPct != null ? leftPct : (tier + 0.5) * 20}%`, borderColor: TIER_COLORS[Math.max(0, Math.min(4, tier))] }}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
/** Figma CTA icon — document with a check-in-circle badge over its bottom-right corner
|
|
121
|
+
* (no single lucide glyph matches; composed from file-text + a knocked-out check-circle).
|
|
122
|
+
* The badge backdrop assumes a filled (primary) button. */
|
|
123
|
+
export const DocCheckIcon: React.FunctionComponent<{ size?: number }> = ({ size = 19 }) => {
|
|
124
|
+
// inline width/height on BOTH icons — `.mbtn .lucide { width/height: 18px }` otherwise
|
|
125
|
+
// inflates the badge to full icon size and it swallows the document
|
|
126
|
+
const badge = Math.max(9, Math.round(size * 0.5));
|
|
127
|
+
return (
|
|
128
|
+
<span style={{ position: 'relative', display: 'inline-flex', flex: 'none' }}>
|
|
129
|
+
<Icon name="file-text" size={size} stroke={2} style={{ width: size, height: size }} />
|
|
130
|
+
<span
|
|
131
|
+
style={{
|
|
132
|
+
position: 'absolute',
|
|
133
|
+
right: -3,
|
|
134
|
+
bottom: -2,
|
|
135
|
+
display: 'flex',
|
|
136
|
+
borderRadius: '50%',
|
|
137
|
+
background: 'var(--md-primary)',
|
|
138
|
+
padding: 1,
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<Icon name="check-circle" size={badge} stroke={2.8} style={{ width: badge, height: badge }} />
|
|
142
|
+
</span>
|
|
143
|
+
</span>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export interface TermChipsProps {
|
|
148
|
+
/** the selectable term values (months), e.g. [12,24,36,48,60,72]. */
|
|
149
|
+
options: number[];
|
|
150
|
+
value: number;
|
|
151
|
+
onChange: (term: number) => void;
|
|
152
|
+
/** i18n function (drilled from the page). */
|
|
153
|
+
t: TranslationFunction;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Laufzeit selector — discrete term values as tappable chips (replaces the fiddly slider). */
|
|
157
|
+
export const TermChips: React.FunctionComponent<TermChipsProps> = ({ options, value, onChange, t }) => (
|
|
158
|
+
<div className="term-chips" role="group" aria-label={t('autobahn:finance.termSelection')}>
|
|
159
|
+
{options.map((m) => (
|
|
160
|
+
<button
|
|
161
|
+
key={m}
|
|
162
|
+
type="button"
|
|
163
|
+
aria-pressed={m === value}
|
|
164
|
+
className={'term-chip' + (m === value ? ' on' : '')}
|
|
165
|
+
onClick={() => onChange(m)}
|
|
166
|
+
>
|
|
167
|
+
{m}
|
|
168
|
+
<span className="tc-unit">{t('autobahn:finance.monthUnit')}</span>
|
|
169
|
+
</button>
|
|
170
|
+
))}
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
export interface CalcRowProps {
|
|
175
|
+
label: React.ReactNode;
|
|
176
|
+
/** when true, drops the bottom hairline (last row). */
|
|
177
|
+
last?: boolean;
|
|
178
|
+
children?: React.ReactNode;
|
|
179
|
+
className?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** One label/value row inside the "Rate anpassen" / "Details" expander. */
|
|
183
|
+
export const CalcRow: React.FunctionComponent<CalcRowProps> = ({ label, last, children, className }) => (
|
|
184
|
+
<div
|
|
185
|
+
className={'calcrow' + (className ? ' ' + className : '')}
|
|
186
|
+
style={{
|
|
187
|
+
display: 'flex',
|
|
188
|
+
justifyContent: 'space-between',
|
|
189
|
+
alignItems: 'baseline',
|
|
190
|
+
gap: 12,
|
|
191
|
+
padding: '8px 0',
|
|
192
|
+
borderBottom: last ? 0 : '1px solid var(--md-outline-variant)',
|
|
193
|
+
}}
|
|
194
|
+
>
|
|
195
|
+
<span className="md-label-sm calcrow-label">{label}</span>
|
|
196
|
+
<span className="num calcrow-value" style={{ fontSize: 13.5, fontWeight: 600 }}>
|
|
197
|
+
{children}
|
|
198
|
+
</span>
|
|
199
|
+
</div>
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
/** full-width label(+optional trailing price) / Switch row — Switch itself is inline-flex
|
|
203
|
+
* (track+label), so the "label ...... price switch" full-row layout can't be expressed via
|
|
204
|
+
* Switch's `label` prop (which renders track-then-label, not a full-width justified row). */
|
|
205
|
+
export const ToggleRow: React.FunctionComponent<{
|
|
206
|
+
label: string;
|
|
207
|
+
price?: string;
|
|
208
|
+
checked: boolean;
|
|
209
|
+
disabled?: boolean;
|
|
210
|
+
onChange: (checked: boolean) => void;
|
|
211
|
+
className?: string;
|
|
212
|
+
/** cash mode: the package is always included — shows a static "inklusive" note instead of the switch. */
|
|
213
|
+
staticNote?: string;
|
|
214
|
+
/** when set, the info icon becomes clickable and opens a popover with this body (e.g. the
|
|
215
|
+
* Rundum-Sorglos-Paket contents) — "Mit Schlussrate" rows omit this, keeping their icon inert. */
|
|
216
|
+
tooltip?: React.ReactNode;
|
|
217
|
+
/** aria-label for the popover's close button — required together with `tooltip`. */
|
|
218
|
+
tooltipCloseLabel?: string;
|
|
219
|
+
/** required together with `tooltip` — builds the trigger's own accessible name (see `infoLabel` below). */
|
|
220
|
+
t?: TranslationFunction;
|
|
221
|
+
}> = ({ label, price, checked, disabled, onChange, className, staticNote, tooltip, tooltipCloseLabel, t }) => {
|
|
222
|
+
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
223
|
+
const toggleTooltip = (e: { stopPropagation: () => void }) => {
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
setTooltipOpen((v) => !v);
|
|
226
|
+
};
|
|
227
|
+
// the visible label alone ("Rundum-Sorglos-Paket") reads as ambiguous out of context (toggle
|
|
228
|
+
// the package? show info about it?) — spell out what activating the trigger actually does.
|
|
229
|
+
const infoLabel = tooltip && t ? t('autobahn:finance.moreInfoAria', { label }) : undefined;
|
|
230
|
+
return (
|
|
231
|
+
<div
|
|
232
|
+
className={className}
|
|
233
|
+
style={{
|
|
234
|
+
display: 'flex',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
justifyContent: staticNote ? undefined : 'space-between',
|
|
237
|
+
gap: 10,
|
|
238
|
+
position: tooltip ? 'relative' : undefined,
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
<span className="md-title-sm" style={{ display: 'inline-flex', alignItems: 'center', gap: 5 }}>
|
|
242
|
+
{label}
|
|
243
|
+
{/* custom info glyph (not the shared lucide "info" from the Icon registry — that name is
|
|
244
|
+
used in many unrelated places, this swap is scoped to just the Rundum-Sorglos-Paket
|
|
245
|
+
tooltip trigger). Shared by all three tabs (Finanzierung/Leasing/Kaufen) and both
|
|
246
|
+
desktop/mobile — ToggleRow itself is the one shared render for all of them. Viewbox
|
|
247
|
+
already bounds every path (1.875–13.125 within 0–15), so no clip-path needed.
|
|
248
|
+
The interactive/focusable/touch-target element is THIS icon wrapper only — the label
|
|
249
|
+
text next to it is plain, inert text, not part of the trigger. */}
|
|
250
|
+
{tooltip && (
|
|
251
|
+
<span
|
|
252
|
+
className="fin-toggle-info-trigger"
|
|
253
|
+
style={{ display: 'inline-flex', cursor: 'pointer' }}
|
|
254
|
+
role="button"
|
|
255
|
+
tabIndex={0}
|
|
256
|
+
aria-label={infoLabel}
|
|
257
|
+
aria-expanded={tooltipOpen}
|
|
258
|
+
onClick={toggleTooltip}
|
|
259
|
+
onKeyDown={(e) => {
|
|
260
|
+
// ARIA authoring practices: a role="button" element must answer to both Enter and
|
|
261
|
+
// Space, not just Enter — a native <button> gets this for free, this span doesn't.
|
|
262
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
263
|
+
e.preventDefault();
|
|
264
|
+
toggleTooltip(e);
|
|
265
|
+
}
|
|
266
|
+
}}
|
|
267
|
+
>
|
|
268
|
+
<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" className="lucide">
|
|
269
|
+
<path d="M7.5 13.125C10.6066 13.125 13.125 10.6066 13.125 7.5C13.125 4.3934 10.6066 1.875 7.5 1.875C4.3934 1.875 1.875 4.3934 1.875 7.5C1.875 10.6066 4.3934 13.125 7.5 13.125Z" stroke="#8B98AA" strokeWidth={1.8} />
|
|
270
|
+
<path d="M7.5 7.2V10.5125" stroke="#8B98AA" strokeWidth={1.8} strokeLinecap="round" />
|
|
271
|
+
<path d="M7.5 4.8125H7.50625" stroke="#8B98AA" strokeWidth={2.4} strokeLinecap="round" />
|
|
272
|
+
</svg>
|
|
273
|
+
</span>
|
|
274
|
+
)}
|
|
275
|
+
</span>
|
|
276
|
+
{tooltip && tooltipOpen && (
|
|
277
|
+
<div className="pp-uvp-tooltip fin-toggle-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
278
|
+
<button
|
|
279
|
+
type="button"
|
|
280
|
+
className="pp-uvp-tooltip-close fin-toggle-tooltip-close"
|
|
281
|
+
aria-label={tooltipCloseLabel}
|
|
282
|
+
onClick={(e) => {
|
|
283
|
+
e.stopPropagation();
|
|
284
|
+
setTooltipOpen(false);
|
|
285
|
+
}}
|
|
286
|
+
>
|
|
287
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
288
|
+
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
289
|
+
</svg>
|
|
290
|
+
</button>
|
|
291
|
+
<div className="pp-uvp-tooltip-body fin-toggle-tooltip-body">{tooltip}</div>
|
|
292
|
+
</div>
|
|
293
|
+
)}
|
|
294
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 10, marginLeft: staticNote ? 'auto' : undefined }}>
|
|
295
|
+
{/* staticNote (cash mode: package is always included, price already baked into the
|
|
296
|
+
fixed price above) fully replaces the price+switch pair — showing "+1.499 €" right
|
|
297
|
+
next to "inklusive" read as contradictory, so price is suppressed whenever
|
|
298
|
+
staticNote is set, not just the switch. */}
|
|
299
|
+
{price && !staticNote && (
|
|
300
|
+
<span className="num" style={{ fontWeight: 700, fontSize: 13.5 }}>
|
|
301
|
+
{price}
|
|
302
|
+
</span>
|
|
303
|
+
)}
|
|
304
|
+
{staticNote ? (
|
|
305
|
+
<span style={{ fontFamily: 'Arial, Arimo, sans-serif', fontWeight: 400, fontSize: 15, lineHeight: '17px', color: '#0E2238' }}>
|
|
306
|
+
{staticNote}
|
|
307
|
+
</span>
|
|
308
|
+
) : (
|
|
309
|
+
<Switch checked={checked} disabled={disabled} onChange={(e) => onChange(e.target.checked)} ariaLabel={label} />
|
|
310
|
+
)}
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/** body content for the "Rundum-Sorglos-Paket" ToggleRow tooltip — intro sentence, bold heading,
|
|
317
|
+
* the package's contents as a bullet list, then (financing/leasing only) a closing paragraph
|
|
318
|
+
* explaining the one-off-vs-financed payment choice. Shared by every addServicesToggle
|
|
319
|
+
* ToggleRow (FinanceCalculator's own card + VdpModules' modal/mobile-sheet instances); intro/
|
|
320
|
+
* outro vary by mode since cash mode has no "financed into the rate" option. */
|
|
321
|
+
export const AddServicesTooltipBody: React.FunctionComponent<{ t: TranslationFunction; isCash?: boolean; isLease?: boolean }> = ({
|
|
322
|
+
t,
|
|
323
|
+
isCash,
|
|
324
|
+
isLease,
|
|
325
|
+
}) => (
|
|
326
|
+
<>
|
|
327
|
+
<p style={{ margin: '0 0 8px' }}>
|
|
328
|
+
{t(isCash ? 'autobahn:finance.addServicesTooltipIntroCash' : 'autobahn:finance.addServicesTooltipIntroFinanced')}
|
|
329
|
+
</p>
|
|
330
|
+
<p style={{ fontFamily: 'Arial, Arimo, sans-serif', fontWeight: 700, fontSize: 10, lineHeight: '13px', color: '#0E2238', margin: '0 0 4px' }}>
|
|
331
|
+
{t('autobahn:finance.addServicesTooltipHeading')}
|
|
332
|
+
</p>
|
|
333
|
+
<ul style={{ margin: 0, padding: '0 0 0 14px' }}>
|
|
334
|
+
{t('autobahn:finance.addServicesTooltipItems')
|
|
335
|
+
.split('\n')
|
|
336
|
+
.map((item) => (
|
|
337
|
+
<li key={item}>{item}</li>
|
|
338
|
+
))}
|
|
339
|
+
</ul>
|
|
340
|
+
{!isCash && (
|
|
341
|
+
<p style={{ margin: '8px 0 0' }}>
|
|
342
|
+
{t(isLease ? 'autobahn:finance.addServicesTooltipOutroLeasing' : 'autobahn:finance.addServicesTooltipOutroFinancing')}
|
|
343
|
+
</p>
|
|
344
|
+
)}
|
|
345
|
+
</>
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
export interface FinanceCalculatorProps {
|
|
349
|
+
/** active payment mode (controlled). */
|
|
350
|
+
mode: FinanceMode;
|
|
351
|
+
/** purchase price in EUR (the cash mode hero). */
|
|
352
|
+
price: number;
|
|
353
|
+
/** previous/list price — when > price, shown struck through as the UVP in cash mode (real discount). */
|
|
354
|
+
listPrice?: number;
|
|
355
|
+
/** auto.de-ID reference code — shown with the financing/leasing condition line. */
|
|
356
|
+
autoDeId?: string;
|
|
357
|
+
/** price-rating label, e.g. 'Guter Preis' — drives the Preisbewertung indicator. */
|
|
358
|
+
ratingLabel?: string;
|
|
359
|
+
/** computed monthly rate in EUR for the current mode — supplied, NOT computed here. */
|
|
360
|
+
monthly: number;
|
|
361
|
+
/** struck old monthly rate (fe-financing oldMonthlyInstallment, isStrikeShown-gated) —
|
|
362
|
+
* rendered as the red line-through figure next to the hero rate (fin/leasing only). */
|
|
363
|
+
oldMonthly?: number;
|
|
364
|
+
/** effective annual rate (%) for the current mode — supplied, NOT computed here. */
|
|
365
|
+
apr: number;
|
|
366
|
+
/** ADV-405 follow-up: financing key figures (Kerndaten) of the CURRENT calculation — the same
|
|
367
|
+
* financing-config values the Finanzierungsdetails layer shows (paybackPeriod, netLoanAmount,
|
|
368
|
+
* totalFinancingAmount else grossLoanAmount, nominalInterestRate, annualPercentageRate). When
|
|
369
|
+
* at least one is real, the financing conditions line shows them instead of "0 € Anzahlung ·
|
|
370
|
+
* 60 Monate". Financing only (leasing/Kaufen ignore it); omit to keep the old line. */
|
|
371
|
+
creditKeyFigures?: CreditKeyFiguresData;
|
|
372
|
+
/** ADV-405 follow-up (leasing confirmed 19.11): leasing key figures of the CURRENT leasing
|
|
373
|
+
* calculation (kind 'leasing', ui/CreditKeyFigures leasingKeyFigures — the Leasingdetails
|
|
374
|
+
* layer's own figures). Shown on the Leasing tab instead of "… Sonderzahlung · … Mon. · … km/Jahr"
|
|
375
|
+
* when at least one is real; omit to keep the old line. */
|
|
376
|
+
leasingKeyFigures?: CreditKeyFiguresData;
|
|
377
|
+
/** current down payment in EUR (controlled). */
|
|
378
|
+
down: number;
|
|
379
|
+
/** current term in months (controlled). */
|
|
380
|
+
term: number;
|
|
381
|
+
/** down-payment slider bounds. */
|
|
382
|
+
downMin: number;
|
|
383
|
+
downMax: number;
|
|
384
|
+
/** down-payment slider step (EUR). */
|
|
385
|
+
downStep?: number;
|
|
386
|
+
/** term slider bounds (months) — used to derive chip options when termOptions is absent. */
|
|
387
|
+
termMin: number;
|
|
388
|
+
termMax: number;
|
|
389
|
+
/** term slider step (months). */
|
|
390
|
+
termStep?: number;
|
|
391
|
+
/** the discrete selectable terms (months) for the Laufzeit chips. */
|
|
392
|
+
termOptions?: number[];
|
|
393
|
+
/** annual mileage in km (controlled) — leasing/financing Laufleistung/Jahr. Omit to hide the slider. */
|
|
394
|
+
annualMileage?: number;
|
|
395
|
+
/** annual-mileage slider bounds + step (km). */
|
|
396
|
+
annualMileageMin?: number;
|
|
397
|
+
annualMileageMax?: number;
|
|
398
|
+
annualMileageStep?: number;
|
|
399
|
+
/** annual-mileage slider changed. */
|
|
400
|
+
onAnnualMileageChange?: (km: number) => void;
|
|
401
|
+
/** "Mit Schlussrate" toggle state (financing only; leasing has no balloon concept). Omit
|
|
402
|
+
* onToggleFinalInstallment to hide the row. */
|
|
403
|
+
withFinalInstallment?: boolean;
|
|
404
|
+
onToggleFinalInstallment?: (checked: boolean) => void;
|
|
405
|
+
/** "Rundum-Sorglos-Paket" toggle state (fin/leasing). Omit addServicesCost or
|
|
406
|
+
* onToggleAddServices to hide the row. */
|
|
407
|
+
withAddServices?: boolean;
|
|
408
|
+
addServicesCost?: number;
|
|
409
|
+
addServicesDisabled?: boolean;
|
|
410
|
+
onToggleAddServices?: (checked: boolean) => void;
|
|
411
|
+
/** Kaufen tab only — real carStore.isAvailable, drives the Verfügbarkeit row (replaces the
|
|
412
|
+
* static Lieferung row). Same source as VdpTrustRow's "Sofort verfügbar" badge. */
|
|
413
|
+
available?: boolean;
|
|
414
|
+
/** phone number shown on the secondary CTA (touch only). */
|
|
415
|
+
phone?: string;
|
|
416
|
+
/** primary CTA click (Angebot sichern). */
|
|
417
|
+
onSecure?: () => void;
|
|
418
|
+
/** true once the customer already has an offer request/checkout in progress for this car —
|
|
419
|
+
* turns the primary CTA green (see .fin-cta-secured) instead of the default filled style. */
|
|
420
|
+
secured?: boolean;
|
|
421
|
+
/** overrides the primary CTA label while `secured` is true (e.g. "Zur Bestellung"). Ignored
|
|
422
|
+
* when `secured` is false — the CTA keeps its own default label in that case. */
|
|
423
|
+
secureLabel?: string;
|
|
424
|
+
/** secondary CTA click (phone). */
|
|
425
|
+
onCall?: () => void;
|
|
426
|
+
/** open the Finanzierungs-/Leasingdetails popup (full breakdown + legal, expanded). Omit to hide the link. */
|
|
427
|
+
onShowDetails?: () => void;
|
|
428
|
+
/** mobile only: open the "Rate anpassen" / "Details anzeigen" sheet (collapsed/default view).
|
|
429
|
+
* Omit to hide the trigger row (falls back to the desktop inline expander). */
|
|
430
|
+
onOpenAdjust?: () => void;
|
|
431
|
+
/** mode segment changed. */
|
|
432
|
+
onModeChange: (mode: FinanceMode) => void;
|
|
433
|
+
/** down-payment slider changed. */
|
|
434
|
+
onDownChange: (down: number) => void;
|
|
435
|
+
/** term changed. */
|
|
436
|
+
onTermChange: (term: number) => void;
|
|
437
|
+
/** whether leasing is actually offered for this car (financingConfig.leasing.isActive — same
|
|
438
|
+
* age/mileage-gated flag SearchResultsStore.getLeasingActive stamps for the cards, see
|
|
439
|
+
* cardParts.tsx's PriceTabs / toAutobahnCar.ts's `lease`). Default true keeps existing callers'
|
|
440
|
+
* behavior; the VDP page passes the real computed value. Hides the Leasing tab when false,
|
|
441
|
+
* same as the card — instead of showing a tab that would compute/display a rate the car isn't
|
|
442
|
+
* eligible for. */
|
|
443
|
+
leasingAvailable?: boolean;
|
|
444
|
+
/** i18n function (drilled from the page). */
|
|
445
|
+
t: TranslationFunction;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const eur = (n: number): string => n.toLocaleString('de-DE');
|
|
449
|
+
|
|
450
|
+
/** build a [min..max] step range (fallback term options when none are supplied). */
|
|
451
|
+
const range = (min: number, max: number, step: number): number[] => {
|
|
452
|
+
const out: number[] = [];
|
|
453
|
+
for (let v = min; v <= max; v += step || 12) out.push(v);
|
|
454
|
+
return out.length ? out : [min];
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/** quiet primary-colored text link (Finanzierungsdetails / Details anzeigen). */
|
|
458
|
+
const DetailsLink: React.FunctionComponent<{ label: string; onClick: () => void }> = ({ label, onClick }) => (
|
|
459
|
+
<button
|
|
460
|
+
type="button"
|
|
461
|
+
onClick={onClick}
|
|
462
|
+
style={{
|
|
463
|
+
display: 'inline-flex',
|
|
464
|
+
alignItems: 'center',
|
|
465
|
+
gap: 5,
|
|
466
|
+
background: 'none',
|
|
467
|
+
border: 0,
|
|
468
|
+
padding: 0,
|
|
469
|
+
cursor: 'pointer',
|
|
470
|
+
color: 'var(--md-primary)',
|
|
471
|
+
font: 'inherit',
|
|
472
|
+
fontSize: 13,
|
|
473
|
+
fontWeight: 600,
|
|
474
|
+
}}
|
|
475
|
+
>
|
|
476
|
+
<Icon name="info" size={15} color="var(--md-primary)" />
|
|
477
|
+
{label}
|
|
478
|
+
</button>
|
|
479
|
+
);
|
|
480
|
+
|
|
481
|
+
/** "Rate anpassen" / "Details anzeigen" expander toggle button. */
|
|
482
|
+
export const expanderBtnStyle: React.CSSProperties = {
|
|
483
|
+
width: '100%',
|
|
484
|
+
background: 'none',
|
|
485
|
+
border: 0,
|
|
486
|
+
cursor: 'pointer',
|
|
487
|
+
display: 'flex',
|
|
488
|
+
alignItems: 'center',
|
|
489
|
+
justifyContent: 'space-between',
|
|
490
|
+
padding: '0 0 2px',
|
|
491
|
+
color: 'var(--md-primary)',
|
|
492
|
+
fontWeight: 600,
|
|
493
|
+
fontSize: 14,
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
const FinanceCalculator: React.FunctionComponent<FinanceCalculatorProps> = ({
|
|
497
|
+
mode,
|
|
498
|
+
price,
|
|
499
|
+
listPrice,
|
|
500
|
+
autoDeId,
|
|
501
|
+
ratingLabel,
|
|
502
|
+
monthly,
|
|
503
|
+
oldMonthly,
|
|
504
|
+
creditKeyFigures,
|
|
505
|
+
leasingKeyFigures,
|
|
506
|
+
down,
|
|
507
|
+
term,
|
|
508
|
+
downMin,
|
|
509
|
+
downMax,
|
|
510
|
+
downStep = 500,
|
|
511
|
+
termMin,
|
|
512
|
+
termMax,
|
|
513
|
+
termStep = 6,
|
|
514
|
+
termOptions,
|
|
515
|
+
annualMileage,
|
|
516
|
+
annualMileageMin = 5000,
|
|
517
|
+
annualMileageMax = 60000,
|
|
518
|
+
annualMileageStep = 5000,
|
|
519
|
+
onAnnualMileageChange,
|
|
520
|
+
withFinalInstallment,
|
|
521
|
+
onToggleFinalInstallment,
|
|
522
|
+
withAddServices,
|
|
523
|
+
addServicesCost,
|
|
524
|
+
addServicesDisabled,
|
|
525
|
+
onToggleAddServices,
|
|
526
|
+
available,
|
|
527
|
+
phone = '0800 40 30 182',
|
|
528
|
+
onSecure,
|
|
529
|
+
secured,
|
|
530
|
+
secureLabel,
|
|
531
|
+
onCall,
|
|
532
|
+
onShowDetails,
|
|
533
|
+
onOpenAdjust,
|
|
534
|
+
onModeChange,
|
|
535
|
+
onDownChange,
|
|
536
|
+
onTermChange,
|
|
537
|
+
leasingAvailable = true,
|
|
538
|
+
t,
|
|
539
|
+
}) => {
|
|
540
|
+
// Pure view state only — whether the adjust/details expander is open.
|
|
541
|
+
const [adjust, setAdjust] = useState(false);
|
|
542
|
+
// whether the "UVP-Rate" footnote popover (fin/leasing) is open — same widget as CarCard's.
|
|
543
|
+
const [uvpTooltipOpen, setUvpTooltipOpen] = useState(false);
|
|
544
|
+
const isCash = mode === 'cash';
|
|
545
|
+
const isLease = mode === 'leasing';
|
|
546
|
+
const terms = termOptions && termOptions.length ? termOptions : range(termMin, termMax, termStep);
|
|
547
|
+
const showStrike = listPrice != null && listPrice > price;
|
|
548
|
+
// price-evaluation tier from the rating label (defaults to 'Guter Preis' tier when unmapped).
|
|
549
|
+
const tierIdx = TIER_LABELS.indexOf(ratingLabel as (typeof TIER_LABELS)[number]);
|
|
550
|
+
const evalTier = tierIdx >= 0 ? tierIdx : 1;
|
|
551
|
+
const isGoodTier = TIER_KEYS[evalTier] === 'good';
|
|
552
|
+
// each tier shows its own real label now (Top/Guter/Fairer/Erhöht/Hoher Preis) — no more
|
|
553
|
+
// collapsing 'good' onto the "Top-Preis" claim. Pill styling (colour/class/footnote) unchanged.
|
|
554
|
+
const evalTierLabel = t('autobahn:tier.' + TIER_KEYS[evalTier]);
|
|
555
|
+
const evalPillColor = isGoodTier ? TIER_COLORS[0] : TIER_COLORS[evalTier];
|
|
556
|
+
// condition summary (current selection) + its own details link — financing: "0 € Anzahlung ·
|
|
557
|
+
// 60 Monate · Finanzierungsdetails"; leasing: "25.000 € Sonderzahlung · 60 Mon. · 10.000
|
|
558
|
+
// km/Jahr · Details" (same wording/order as CarCard's own PriceTerms leaseTerms).
|
|
559
|
+
const condParts: string[] = [];
|
|
560
|
+
if (mode === 'leasing') {
|
|
561
|
+
condParts.push(
|
|
562
|
+
...t('autobahn:card.price.leaseTerms', {
|
|
563
|
+
firstInstallment: eur(down),
|
|
564
|
+
months: term,
|
|
565
|
+
mileage: annualMileage != null ? eur(annualMileage) : '',
|
|
566
|
+
}).split(' · '),
|
|
567
|
+
);
|
|
568
|
+
} else if (!isCash) {
|
|
569
|
+
condParts.push(t('autobahn:finance.downPaymentLabel', { value: eur(down) }));
|
|
570
|
+
condParts.push(t('autobahn:finance.monthsLabel', { months: term, count: term }));
|
|
571
|
+
}
|
|
572
|
+
// ADV-405 follow-up: financing shows the key figures (Kerndaten) in place of the line above —
|
|
573
|
+
// only when at least one figure is real, else the old "0 € Anzahlung · 60 Monate" line stays.
|
|
574
|
+
const tabKeyFigures = mode === 'fin' ? creditKeyFigures : mode === 'leasing' ? leasingKeyFigures : undefined;
|
|
575
|
+
const keyFigures = tabKeyFigures && hasCreditKeyFigures(tabKeyFigures) ? tabKeyFigures : undefined;
|
|
576
|
+
|
|
577
|
+
return (
|
|
578
|
+
<div className="mcard mcard--elevated fin-calc-card" style={{ padding: 20 }}>
|
|
579
|
+
{/* header — desktop only; mobile goes straight into the tabs (see mockup: no card
|
|
580
|
+
title above Finanzierung/Leasing/Kaufen on phone). */}
|
|
581
|
+
<div className="fin-card-header hide-mobile" style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
|
|
582
|
+
<span
|
|
583
|
+
style={{
|
|
584
|
+
width: 34,
|
|
585
|
+
height: 34,
|
|
586
|
+
borderRadius: 'var(--md-r-full)',
|
|
587
|
+
background: 'var(--md-primary-container)',
|
|
588
|
+
display: 'flex',
|
|
589
|
+
alignItems: 'center',
|
|
590
|
+
justifyContent: 'center',
|
|
591
|
+
flex: 'none',
|
|
592
|
+
}}
|
|
593
|
+
>
|
|
594
|
+
<Icon name="tag" size={18} color="var(--md-on-primary-container)" />
|
|
595
|
+
</span>
|
|
596
|
+
<div style={{ fontFamily: 'var(--md-font-display)', fontSize: 18, fontWeight: 700 }}>{t('autobahn:finance.headerTitle')}</div>
|
|
597
|
+
</div>
|
|
598
|
+
|
|
599
|
+
{/* payment-type TABS on top — Leasing omitted when the car isn't leasing-eligible, same
|
|
600
|
+
rule cardParts.tsx's PriceTabs already applies (car.lease != null there). */}
|
|
601
|
+
<div className="fin-tabs" role="tablist">
|
|
602
|
+
{(
|
|
603
|
+
[
|
|
604
|
+
['fin', 'autobahn:finance.mode.financing'],
|
|
605
|
+
...(leasingAvailable ? ([['leasing', 'autobahn:finance.mode.leasing']] as Array<[FinanceMode, string]>) : []),
|
|
606
|
+
['cash', 'autobahn:finance.mode.cash'],
|
|
607
|
+
] as Array<[FinanceMode, string]>
|
|
608
|
+
).map(([k, labelKey]) => (
|
|
609
|
+
<button
|
|
610
|
+
key={k}
|
|
611
|
+
type="button"
|
|
612
|
+
role="tab"
|
|
613
|
+
aria-selected={mode === k}
|
|
614
|
+
className={'fin-tab' + (mode === k ? ' on' : '')}
|
|
615
|
+
onClick={() => onModeChange(k)}
|
|
616
|
+
>
|
|
617
|
+
{k === 'cash' ? (
|
|
618
|
+
<>
|
|
619
|
+
{/* cash tab is "Kaufen" on both phone and desktop now — same key both spans. */}
|
|
620
|
+
<span className="hide-mobile">{t('autobahn:card.price.buy')}</span>
|
|
621
|
+
<span className="show-mobile" style={{ justifyContent: 'center' }}>
|
|
622
|
+
{t('autobahn:card.price.buy')}
|
|
623
|
+
</span>
|
|
624
|
+
</>
|
|
625
|
+
) : (
|
|
626
|
+
t(labelKey)
|
|
627
|
+
)}
|
|
628
|
+
</button>
|
|
629
|
+
))}
|
|
630
|
+
</div>
|
|
631
|
+
|
|
632
|
+
{/* 2-col grid: rate|pill (row 1) + condLine|bar (row 2) — fixed right column prevents wrapping */}
|
|
633
|
+
<div className={'fin-price-grid' + (isCash ? ' fin-price-grid--cash' : '')}>
|
|
634
|
+
{/* col 1 row 1: hero rate — Figma: "329 €" all-big, then a small stacked column with
|
|
635
|
+
the struck old rate ABOVE "/mtl." (round 11; was a single baseline row) */}
|
|
636
|
+
<div className="fin-rate-main">
|
|
637
|
+
{/* mobile Kaufen (Figma round 14): struck list price ABOVE the price, right-aligned,
|
|
638
|
+
tight to the figure — replaces the Festpreis + UVP lines, which stay desktop-only */}
|
|
639
|
+
{isCash && showStrike && (
|
|
640
|
+
<div
|
|
641
|
+
className="show-mobile"
|
|
642
|
+
style={{ justifyContent: 'flex-end', alignItems: 'baseline', gap: 4, lineHeight: 1, marginTop: 7 }}
|
|
643
|
+
role="button"
|
|
644
|
+
tabIndex={0}
|
|
645
|
+
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
646
|
+
>
|
|
647
|
+
{/* ADV-423: same size as the struck price next to it (md3.css .pp-uvp-label) */}
|
|
648
|
+
<span
|
|
649
|
+
className={`pp-uvp-label${
|
|
650
|
+
String(Math.round(listPrice as number)).length === 5
|
|
651
|
+
? ' pp-uvp-label--len5'
|
|
652
|
+
: String(Math.round(listPrice as number)).length === 4
|
|
653
|
+
? ' pp-uvp-label--len4'
|
|
654
|
+
: ''
|
|
655
|
+
}`}
|
|
656
|
+
>
|
|
657
|
+
{t('autobahn:finance.uvp')}
|
|
658
|
+
</span>
|
|
659
|
+
<span
|
|
660
|
+
className={`num pp-hero-old${
|
|
661
|
+
String(Math.round(listPrice as number)).length === 5
|
|
662
|
+
? ' pp-hero-old--len5'
|
|
663
|
+
: String(Math.round(listPrice as number)).length === 4
|
|
664
|
+
? ' pp-hero-old--len4'
|
|
665
|
+
: ''
|
|
666
|
+
}`}
|
|
667
|
+
>
|
|
668
|
+
{eur(Math.round(listPrice as number))} €
|
|
669
|
+
<span
|
|
670
|
+
className="pp-eyebrow-badge"
|
|
671
|
+
role="button"
|
|
672
|
+
tabIndex={0}
|
|
673
|
+
onClick={(e) => {
|
|
674
|
+
e.stopPropagation();
|
|
675
|
+
setUvpTooltipOpen((v) => !v);
|
|
676
|
+
}}
|
|
677
|
+
>
|
|
678
|
+
2
|
|
679
|
+
</span>
|
|
680
|
+
{uvpTooltipOpen && (
|
|
681
|
+
<div className="pp-uvp-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
682
|
+
<button
|
|
683
|
+
type="button"
|
|
684
|
+
className="pp-uvp-tooltip-close"
|
|
685
|
+
aria-label={t('autobahn:modal.close')}
|
|
686
|
+
onClick={(e) => {
|
|
687
|
+
e.stopPropagation();
|
|
688
|
+
setUvpTooltipOpen(false);
|
|
689
|
+
}}
|
|
690
|
+
>
|
|
691
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
692
|
+
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
693
|
+
</svg>
|
|
694
|
+
</button>
|
|
695
|
+
<div className="pp-uvp-tooltip-body">{t('autobahn:card.price.uvpListTooltipBody')}</div>
|
|
696
|
+
</div>
|
|
697
|
+
)}
|
|
698
|
+
</span>
|
|
699
|
+
</div>
|
|
700
|
+
)}
|
|
701
|
+
{/* desktop: same struck list price ABOVE the rate, same fin-rate-old-list styling +
|
|
702
|
+
clickable UVP badge/tooltip as the mobile sheet's own Kaufen block.
|
|
703
|
+
Wrapper now renders on EVERY Kaufen car (isCash alone, not isCash && showStrike) —
|
|
704
|
+
cross-tab height parity (md3.css) reserves this row's height once, assuming it's
|
|
705
|
+
always there; a car with no discount used to skip it entirely, landing .fin-rate-main
|
|
706
|
+
(and the whole card) ~20px shorter than a discounted one and breaking that parity.
|
|
707
|
+
fin-rate-strike-slot (md3.css) gives it a fixed height so the slot itself doesn't
|
|
708
|
+
move even though the <s> price inside is still conditional on showStrike. */}
|
|
709
|
+
{isCash && (
|
|
710
|
+
<div
|
|
711
|
+
className="hide-mobile fin-rate-strike-slot"
|
|
712
|
+
style={{
|
|
713
|
+
display: 'flex',
|
|
714
|
+
justifyContent: 'flex-end',
|
|
715
|
+
alignItems: 'baseline',
|
|
716
|
+
lineHeight: 1,
|
|
717
|
+
marginTop: 0,
|
|
718
|
+
cursor: showStrike ? 'pointer' : 'default',
|
|
719
|
+
}}
|
|
720
|
+
role="button"
|
|
721
|
+
tabIndex={0}
|
|
722
|
+
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
723
|
+
>
|
|
724
|
+
{/* ADV-423: "UVP" label right before the struck list price (this slot is desktop-only) */}
|
|
725
|
+
{showStrike && <span className="pp-uvp-label">{t('autobahn:finance.uvp')}</span>}
|
|
726
|
+
{showStrike && (
|
|
727
|
+
<s className="num fin-rate-old fin-rate-old-list">
|
|
728
|
+
{eur(listPrice as number)} €
|
|
729
|
+
<span
|
|
730
|
+
className="pp-eyebrow-badge"
|
|
731
|
+
role="button"
|
|
732
|
+
tabIndex={0}
|
|
733
|
+
onClick={(e) => {
|
|
734
|
+
e.stopPropagation();
|
|
735
|
+
setUvpTooltipOpen((v) => !v);
|
|
736
|
+
}}
|
|
737
|
+
>
|
|
738
|
+
2
|
|
739
|
+
</span>
|
|
740
|
+
{uvpTooltipOpen && (
|
|
741
|
+
<div className="pp-uvp-tooltip" onClick={(e) => e.stopPropagation()}>
|
|
742
|
+
<button
|
|
743
|
+
type="button"
|
|
744
|
+
className="pp-uvp-tooltip-close"
|
|
745
|
+
aria-label={t('autobahn:modal.close')}
|
|
746
|
+
onClick={(e) => {
|
|
747
|
+
e.stopPropagation();
|
|
748
|
+
setUvpTooltipOpen(false);
|
|
749
|
+
}}
|
|
750
|
+
>
|
|
751
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
752
|
+
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
753
|
+
</svg>
|
|
754
|
+
</button>
|
|
755
|
+
<div className="pp-uvp-tooltip-body">{t('autobahn:card.price.uvpListTooltipBody')}</div>
|
|
756
|
+
</div>
|
|
757
|
+
)}
|
|
758
|
+
</s>
|
|
759
|
+
)}
|
|
760
|
+
</div>
|
|
761
|
+
)}
|
|
762
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: 7 }}>
|
|
763
|
+
{isCash ? (
|
|
764
|
+
<>
|
|
765
|
+
{/* phone: ONE unbreakable "13.249 €" span (a separate € span wraps to its own
|
|
766
|
+
line); desktop keeps the number + quiet small € pair */}
|
|
767
|
+
<span
|
|
768
|
+
className={`num show-mobile fin-rate-cash-mobile${
|
|
769
|
+
(() => {
|
|
770
|
+
const digits = String(Math.round(price as number)).length;
|
|
771
|
+
if (digits >= 8) return ' fin-rate-cash-mobile--len8';
|
|
772
|
+
if (digits === 7) return ' fin-rate-cash-mobile--len7';
|
|
773
|
+
if (digits === 6) return ' fin-rate-cash-mobile--len6';
|
|
774
|
+
return '';
|
|
775
|
+
})()
|
|
776
|
+
}`}
|
|
777
|
+
style={{ fontSize: 48, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px', whiteSpace: 'nowrap' }}
|
|
778
|
+
>
|
|
779
|
+
{eur(price)} €<sup>1</sup>
|
|
780
|
+
</span>
|
|
781
|
+
<span
|
|
782
|
+
className="num hide-mobile"
|
|
783
|
+
style={{ fontSize: 45, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px' }}
|
|
784
|
+
>
|
|
785
|
+
{eur(price)} €<sup>1</sup>
|
|
786
|
+
</span>
|
|
787
|
+
</>
|
|
788
|
+
) : (
|
|
789
|
+
<>
|
|
790
|
+
<span
|
|
791
|
+
className={`num fin-rate-hero${
|
|
792
|
+
(() => {
|
|
793
|
+
const digits = String(Math.round(monthly)).length;
|
|
794
|
+
if (digits >= 6) return ' fin-rate-hero--len6';
|
|
795
|
+
if (digits === 5) return ' fin-rate-hero--len5';
|
|
796
|
+
if (digits === 4) return ' fin-rate-hero--len4';
|
|
797
|
+
return '';
|
|
798
|
+
})()
|
|
799
|
+
}`}
|
|
800
|
+
style={{ fontSize: 48, fontWeight: 800, color: 'var(--md-primary)', letterSpacing: '-2px' }}
|
|
801
|
+
>
|
|
802
|
+
{eur(Math.round(monthly))}<span style={{ marginLeft: 6 }}>€</span>
|
|
803
|
+
</span>
|
|
804
|
+
<span className="fin-rate-unit">
|
|
805
|
+
{/* struck old rate (REAL oldMonthlyInstallment; SRP strikes the same source) */}
|
|
806
|
+
{oldMonthly != null && (
|
|
807
|
+
<span
|
|
808
|
+
style={{ display: 'flex', flexDirection: 'column', cursor: 'pointer' }}
|
|
809
|
+
role="button"
|
|
810
|
+
tabIndex={0}
|
|
811
|
+
onClick={() => setUvpTooltipOpen((v) => !v)}
|
|
812
|
+
>
|
|
813
|
+
<span className="pp-eyebrow">
|
|
814
|
+
{t('autobahn:card.price.uvpRateLabel')}
|
|
815
|
+
<span
|
|
816
|
+
className="pp-eyebrow-badge"
|
|
817
|
+
role="button"
|
|
818
|
+
tabIndex={0}
|
|
819
|
+
onClick={(e) => {
|
|
820
|
+
e.stopPropagation();
|
|
821
|
+
setUvpTooltipOpen((v) => !v);
|
|
822
|
+
}}
|
|
823
|
+
>
|
|
824
|
+
3
|
|
825
|
+
</span>
|
|
826
|
+
{uvpTooltipOpen && (
|
|
827
|
+
<div
|
|
828
|
+
className={'pp-uvp-tooltip' + (mode === 'leasing' ? ' pp-uvp-tooltip--leasing' : '')}
|
|
829
|
+
onClick={(e) => e.stopPropagation()}
|
|
830
|
+
>
|
|
831
|
+
<button
|
|
832
|
+
type="button"
|
|
833
|
+
className="pp-uvp-tooltip-close"
|
|
834
|
+
aria-label={t('autobahn:modal.close')}
|
|
835
|
+
onClick={(e) => {
|
|
836
|
+
e.stopPropagation();
|
|
837
|
+
setUvpTooltipOpen(false);
|
|
838
|
+
}}
|
|
839
|
+
>
|
|
840
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
841
|
+
<path d="M5 5L15 15M15 5L5 15" stroke="white" strokeWidth={2.4} strokeLinecap="round" />
|
|
842
|
+
</svg>
|
|
843
|
+
</button>
|
|
844
|
+
<div className="pp-uvp-tooltip-body">
|
|
845
|
+
{t(
|
|
846
|
+
mode === 'leasing'
|
|
847
|
+
? 'autobahn:card.price.uvpRateTooltipBodyLeasing'
|
|
848
|
+
: 'autobahn:card.price.uvpRateTooltipBody',
|
|
849
|
+
)}
|
|
850
|
+
</div>
|
|
851
|
+
</div>
|
|
852
|
+
)}
|
|
853
|
+
</span>
|
|
854
|
+
<s
|
|
855
|
+
className={`num fin-rate-old fin-rate-example-price${
|
|
856
|
+
String(Math.round(oldMonthly)).length >= 5
|
|
857
|
+
? ' fin-rate-example-price--len5'
|
|
858
|
+
: String(Math.round(oldMonthly)).length === 4
|
|
859
|
+
? ' fin-rate-example-price--len4'
|
|
860
|
+
: ''
|
|
861
|
+
}`}
|
|
862
|
+
>
|
|
863
|
+
{eur(Math.round(oldMonthly))} €
|
|
864
|
+
</s>
|
|
865
|
+
</span>
|
|
866
|
+
)}
|
|
867
|
+
{/* no struck old rate above it (strike hidden) — nudge "/mtl." down so it
|
|
868
|
+
sits level with the blue hero rate instead of centering high in the row. */}
|
|
869
|
+
<span
|
|
870
|
+
className="fin-rate-example-suffix"
|
|
871
|
+
style={oldMonthly == null ? { paddingTop: 20 } : undefined}
|
|
872
|
+
>
|
|
873
|
+
{t('autobahn:finance.perMonth')}
|
|
874
|
+
</span>
|
|
875
|
+
</span>
|
|
876
|
+
</>
|
|
877
|
+
)}
|
|
878
|
+
</div>
|
|
879
|
+
{isCash && <div className="md-label-sm hide-mobile">{t('autobahn:finance.fixedPrice')}</div>}
|
|
880
|
+
</div>
|
|
881
|
+
{/* col 2: pill + eval bar grouped together (display:contents on desktop — no-op,
|
|
882
|
+
preserves the original rate|pill / cond|bar auto-placement; mobile turns this into
|
|
883
|
+
a real flex column so the two stack tight with a fixed 16px gap). */}
|
|
884
|
+
<div className="fin-eval-col">
|
|
885
|
+
{/* col 2 row 1: price-rating pill (Figma: bold colored label, NO icon) */}
|
|
886
|
+
<div className="fin-eval-pill-cell">
|
|
887
|
+
{ratingLabel && (
|
|
888
|
+
<span
|
|
889
|
+
className={`fin-eval-pill${isGoodTier ? ' fin-eval-pill--good' : ''}`}
|
|
890
|
+
style={{ color: evalPillColor, background: `color-mix(in srgb, ${evalPillColor} 16%, transparent)` }}
|
|
891
|
+
aria-label={t('autobahn:finance.priceRatingAria', { rating: evalTierLabel })}
|
|
892
|
+
>
|
|
893
|
+
{evalTierLabel}
|
|
894
|
+
{isGoodTier && <sup>4</sup>}
|
|
895
|
+
</span>
|
|
896
|
+
)}
|
|
897
|
+
</div>
|
|
898
|
+
{/* segmented evaluation bar (Figma: discrete tiers, not a gradient) */}
|
|
899
|
+
<div className="fin-eval-bar-cell">{ratingLabel && <EvalBar tier={evalTier} />}</div>
|
|
900
|
+
</div>
|
|
901
|
+
{/* col 1 row 2: condition line — financing "0 € Anzahlung · 60 Monate · Finanzierungsdetails",
|
|
902
|
+
leasing "25.000 € Sonderzahlung · 60 Mon. · 10.000 km/Jahr · Details". Buy has nothing
|
|
903
|
+
to show here (no down payment/term/details link of its own) — not rendered at all
|
|
904
|
+
rather than left as an empty reserved-height div.
|
|
905
|
+
ADV-405 follow-up: financing with real key figures → the Kerndaten (2 lines, same
|
|
906
|
+
.fin-cond grid cell/size/colour, wraps where narrow) ending with the same details link. */}
|
|
907
|
+
{keyFigures ? (
|
|
908
|
+
<CreditKeyFigures
|
|
909
|
+
t={t}
|
|
910
|
+
figures={keyFigures}
|
|
911
|
+
cls="fin-cond fin-ckf"
|
|
912
|
+
details={
|
|
913
|
+
onShowDetails && (
|
|
914
|
+
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
915
|
+
{mode === 'leasing' ? t('autobahn:card.price.detailsLink') : t('autobahn:finance.financingDetails')}
|
|
916
|
+
</button>
|
|
917
|
+
)
|
|
918
|
+
}
|
|
919
|
+
/>
|
|
920
|
+
) : !isCash && (
|
|
921
|
+
<div className="fin-cond">
|
|
922
|
+
{condParts.map((part, i) => (
|
|
923
|
+
<React.Fragment key={i}>
|
|
924
|
+
{i > 0 && <span className="cc-terms-dot"> · </span>}
|
|
925
|
+
{part}
|
|
926
|
+
</React.Fragment>
|
|
927
|
+
))}
|
|
928
|
+
{onShowDetails && (
|
|
929
|
+
<>
|
|
930
|
+
<span className="cc-terms-dot"> · </span>
|
|
931
|
+
{/* plain underlined text link, same onShowDetails handler as .fin-info used to open. */}
|
|
932
|
+
<button type="button" className="cc-terms-link" onClick={onShowDetails}>
|
|
933
|
+
{mode === 'leasing' ? t('autobahn:card.price.detailsLink') : t('autobahn:finance.financingDetails')}
|
|
934
|
+
</button>
|
|
935
|
+
</>
|
|
936
|
+
)}
|
|
937
|
+
</div>
|
|
938
|
+
)}
|
|
939
|
+
</div>
|
|
940
|
+
|
|
941
|
+
{/* ADV-405/406 Kreditkosten-Hinweis — Preis-Card (mobile) + „Dein Angebot“ (desktop): below the
|
|
942
|
+
conditions line, above „Angebot anfragen“/„Anrufen“ (mobile) or „Rate anpassen“ (desktop).
|
|
943
|
+
Not on Kaufen (no reserved space — the Kaufen view stays exactly as before). */}
|
|
944
|
+
{!isCash && <CreditCostNotice t={t} cls="fin-ccn" />}
|
|
945
|
+
|
|
946
|
+
{/* ============================== DESKTOP (≥601px) — unchanged ============================== */}
|
|
947
|
+
<div className="hide-mobile">
|
|
948
|
+
{/* RATE EDIT (Rate anpassen) — between the rate and the request CTA. fin-adjust--cash:
|
|
949
|
+
Kaufen-only margin-top override (0, was the shared 14px) — see md3.css. */}
|
|
950
|
+
<div className={'fin-adjust' + (isCash ? ' fin-adjust--cash' : '')}>
|
|
951
|
+
<button onClick={() => setAdjust((a) => !a)} style={expanderBtnStyle}>
|
|
952
|
+
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 7 }}>
|
|
953
|
+
<Icon name={isCash ? 'list' : 'sliders-horizontal'} size={16} color="var(--md-primary)" />
|
|
954
|
+
{isCash ? t('autobahn:finance.detailsShow') : t('autobahn:finance.adjustRate')}
|
|
955
|
+
</span>
|
|
956
|
+
<Icon name={adjust ? 'chevron-up' : 'chevron-down'} size={18} color="var(--md-primary)" />
|
|
957
|
+
</button>
|
|
958
|
+
{adjust &&
|
|
959
|
+
(isCash ? (
|
|
960
|
+
<>
|
|
961
|
+
<div style={{ marginTop: 4 }}>
|
|
962
|
+
<CalcRow label={t('autobahn:finance.paymentLabel')} last={!available && !(addServicesCost != null && onToggleAddServices)}>{t('autobahn:finance.paymentValue')}</CalcRow>
|
|
963
|
+
{available && (
|
|
964
|
+
<CalcRow label={t('autobahn:finance.availabilityLabel')} last={!(addServicesCost != null && onToggleAddServices)}>
|
|
965
|
+
{t('autobahn:finance.availabilityValue')}
|
|
966
|
+
</CalcRow>
|
|
967
|
+
)}
|
|
968
|
+
</div>
|
|
969
|
+
{addServicesCost != null && onToggleAddServices && (
|
|
970
|
+
<ToggleRow
|
|
971
|
+
className="fin-toggle-addservices fin-toggle-addservices--cash"
|
|
972
|
+
label={t('autobahn:finance.addServicesToggle')}
|
|
973
|
+
price={t('autobahn:finance.addServicesOnce', { value: eur(Math.round(addServicesCost)) })}
|
|
974
|
+
checked={!!withAddServices}
|
|
975
|
+
disabled={addServicesDisabled}
|
|
976
|
+
onChange={onToggleAddServices}
|
|
977
|
+
staticNote={t('autobahn:finance.addServicesIncluded')}
|
|
978
|
+
tooltip={<AddServicesTooltipBody t={t} isCash />}
|
|
979
|
+
tooltipCloseLabel={t('autobahn:modal.close')}
|
|
980
|
+
t={t}
|
|
981
|
+
/>
|
|
982
|
+
)}
|
|
983
|
+
</>
|
|
984
|
+
) : (
|
|
985
|
+
<div style={{ display: 'flex', flexDirection: 'column', marginTop: 8 }}>
|
|
986
|
+
<div style={{ marginBottom: 15 }}>
|
|
987
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 6 }}>
|
|
988
|
+
<span className="md-title-sm">{t('autobahn:finance.downPaymentSliderLabel')}</span>
|
|
989
|
+
<span className="num" style={{ fontWeight: 700 }}>
|
|
990
|
+
{eur(down)} €
|
|
991
|
+
</span>
|
|
992
|
+
</div>
|
|
993
|
+
<Slider
|
|
994
|
+
min={downMin}
|
|
995
|
+
max={downMax}
|
|
996
|
+
step={downStep}
|
|
997
|
+
value={down}
|
|
998
|
+
onChange={onDownChange}
|
|
999
|
+
fmt={(v) => `${eur(Number(v))} €`}
|
|
1000
|
+
/>
|
|
1001
|
+
</div>
|
|
1002
|
+
{annualMileage != null && onAnnualMileageChange && (
|
|
1003
|
+
<div style={{ marginBottom: 15 }}>
|
|
1004
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 6 }}>
|
|
1005
|
+
<span className="md-title-sm">{t('autobahn:finance.annualMileageLabel')}</span>
|
|
1006
|
+
<span className="num" style={{ fontWeight: 700 }}>
|
|
1007
|
+
{eur(annualMileage)} km
|
|
1008
|
+
</span>
|
|
1009
|
+
</div>
|
|
1010
|
+
<Slider
|
|
1011
|
+
min={annualMileageMin}
|
|
1012
|
+
max={annualMileageMax}
|
|
1013
|
+
step={annualMileageStep}
|
|
1014
|
+
value={annualMileage}
|
|
1015
|
+
onChange={onAnnualMileageChange}
|
|
1016
|
+
fmt={(v) => `${eur(Number(v))} km`}
|
|
1017
|
+
/>
|
|
1018
|
+
</div>
|
|
1019
|
+
)}
|
|
1020
|
+
<div style={{ marginBottom: 15 }}>
|
|
1021
|
+
<div className="md-title-sm" style={{ marginBottom: 8 }}>
|
|
1022
|
+
{t('autobahn:finance.termSelection')}
|
|
1023
|
+
</div>
|
|
1024
|
+
<TermChips options={terms.filter((v) => v !== 12 && v !== 96)} value={term} onChange={onTermChange} t={t} />
|
|
1025
|
+
</div>
|
|
1026
|
+
{/* same Mit-Schlussrate / Rundum-Sorglos-Paket toggles as the mobile sheet / modal
|
|
1027
|
+
desktop block — replaces the static Kaufpreis/Garantie/Lieferung rows. */}
|
|
1028
|
+
{!isLease && onToggleFinalInstallment && (
|
|
1029
|
+
<ToggleRow
|
|
1030
|
+
className="fin-toggle-final"
|
|
1031
|
+
label={t('autobahn:finance.finalInstallmentToggle')}
|
|
1032
|
+
checked={!!withFinalInstallment}
|
|
1033
|
+
onChange={onToggleFinalInstallment}
|
|
1034
|
+
/>
|
|
1035
|
+
)}
|
|
1036
|
+
{addServicesCost != null && onToggleAddServices && (
|
|
1037
|
+
<ToggleRow
|
|
1038
|
+
className={'fin-toggle-addservices' + (isLease ? ' fin-toggle-addservices--leasing' : '')}
|
|
1039
|
+
label={t('autobahn:finance.addServicesToggle')}
|
|
1040
|
+
price={t('autobahn:finance.addServicesPerMonth', { value: eur(Math.round(addServicesCost)) })}
|
|
1041
|
+
checked={!!withAddServices}
|
|
1042
|
+
disabled={addServicesDisabled}
|
|
1043
|
+
onChange={onToggleAddServices}
|
|
1044
|
+
tooltip={<AddServicesTooltipBody t={t} isLease={isLease} />}
|
|
1045
|
+
tooltipCloseLabel={t('autobahn:modal.close')}
|
|
1046
|
+
t={t}
|
|
1047
|
+
/>
|
|
1048
|
+
)}
|
|
1049
|
+
</div>
|
|
1050
|
+
))}
|
|
1051
|
+
</div>
|
|
1052
|
+
|
|
1053
|
+
{/* REQUEST CTA */}
|
|
1054
|
+
<Button
|
|
1055
|
+
variant="filled"
|
|
1056
|
+
block
|
|
1057
|
+
size="lg"
|
|
1058
|
+
icon="shield-check"
|
|
1059
|
+
className={secured ? 'fin-cta-secured' : undefined}
|
|
1060
|
+
style={{ marginTop: 14 }}
|
|
1061
|
+
onClick={onSecure}
|
|
1062
|
+
>
|
|
1063
|
+
{secured && secureLabel ? secureLabel : t('autobahn:finance.secureOffer')}
|
|
1064
|
+
</Button>
|
|
1065
|
+
{/* phone CTA — touch only (hidden on desktop via .fin-call) */}
|
|
1066
|
+
<div className="fin-call">
|
|
1067
|
+
<Button variant="outlined" block icon="phone" onClick={onCall}>
|
|
1068
|
+
{phone}
|
|
1069
|
+
</Button>
|
|
1070
|
+
</div>
|
|
1071
|
+
|
|
1072
|
+
{/* auto.de-ID in front of the Finanzierungs-/Leasingdetails link — one row, under everything */}
|
|
1073
|
+
{(autoDeId || (!isCash && onShowDetails)) && (
|
|
1074
|
+
<div className="fin-info">
|
|
1075
|
+
{autoDeId && <span className="fin-id">auto.de-ID {autoDeId}</span>}
|
|
1076
|
+
{!isCash && onShowDetails && (
|
|
1077
|
+
<DetailsLink
|
|
1078
|
+
label={mode === 'leasing' ? t('autobahn:finance.leasingDetails') : t('autobahn:finance.financingDetails')}
|
|
1079
|
+
onClick={onShowDetails}
|
|
1080
|
+
/>
|
|
1081
|
+
)}
|
|
1082
|
+
</div>
|
|
1083
|
+
)}
|
|
1084
|
+
</div>
|
|
1085
|
+
|
|
1086
|
+
{/* ============================== MOBILE (≤600px) — new layout ============================== */}
|
|
1087
|
+
<div className="show-mobile" style={{ flexDirection: 'column' }}>
|
|
1088
|
+
{/* side-by-side CTAs — mockup ratio ~2:1, with the tiny auto.de-ID sitting
|
|
1089
|
+
directly under the Anrufen button (not in its own full-width row). */}
|
|
1090
|
+
<div className="fin-cta-row" style={{ display: 'flex', gap: 10, alignItems: 'flex-start' }}>
|
|
1091
|
+
{/* Figma CTA icon: document + check badge (composed — no single lucide glyph) */}
|
|
1092
|
+
<Button
|
|
1093
|
+
variant="filled"
|
|
1094
|
+
size="lg"
|
|
1095
|
+
className={secured ? 'fin-cta-secured' : undefined}
|
|
1096
|
+
style={{ width: 216, height: 50, paddingLeft: 0, paddingRight: 9, gap: secured ? 3 : 18 }}
|
|
1097
|
+
onClick={onSecure}
|
|
1098
|
+
>
|
|
1099
|
+
{/* size 23 either way — was 18 for the secured (shield-check) state, notably
|
|
1100
|
+
smaller than DocCheckIcon's 23 in the default state despite sharing the exact
|
|
1101
|
+
same 50px button box; nothing about switching to "already secured" should
|
|
1102
|
+
shrink the icon. */}
|
|
1103
|
+
{secured ? <Icon name="shield-check" size={23} /> : <DocCheckIcon size={23} />}
|
|
1104
|
+
{secured && secureLabel ? secureLabel : t('autobahn:finance.secureOffer')}
|
|
1105
|
+
</Button>
|
|
1106
|
+
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 4, minWidth: 0 }}>
|
|
1107
|
+
<Button variant="outlined" size="lg" icon="phone" style={{ width: 112, height: 50 }} onClick={onCall}>
|
|
1108
|
+
{t('autobahn:finance.callCta')}
|
|
1109
|
+
</Button>
|
|
1110
|
+
{autoDeId && (
|
|
1111
|
+
<span
|
|
1112
|
+
className="num"
|
|
1113
|
+
style={{ fontSize: 10, fontWeight: 700, color: 'var(--md-primary)', textAlign: 'center', whiteSpace: 'nowrap' }}
|
|
1114
|
+
>
|
|
1115
|
+
auto.de ID: {autoDeId}
|
|
1116
|
+
</span>
|
|
1117
|
+
)}
|
|
1118
|
+
</div>
|
|
1119
|
+
</div>
|
|
1120
|
+
|
|
1121
|
+
{/* Persönliche Beratung — icon + one line (the details link now lives in .fin-cond above) */}
|
|
1122
|
+
<div className="fin-info" style={{ justifyContent: 'flex-start', paddingLeft: 15 }}>
|
|
1123
|
+
<Icon name="user" size={26} color="var(--md-on-surface-variant)" style={{ flex: 'none', marginRight: 20 }} />
|
|
1124
|
+
<span className="fin-info-line">{t('autobahn:finance.personalConsultationLine')}</span>
|
|
1125
|
+
</div>
|
|
1126
|
+
|
|
1127
|
+
{/* "Rate anpassen" / "Details anzeigen" — opens the full bottom sheet (not an inline expander) */}
|
|
1128
|
+
{onOpenAdjust && (
|
|
1129
|
+
<button
|
|
1130
|
+
type="button"
|
|
1131
|
+
onClick={onOpenAdjust}
|
|
1132
|
+
style={{ ...expanderBtnStyle, borderTop: '1px solid var(--md-outline-variant)', marginTop: 11, padding: '11px 0 2px 21px' }}
|
|
1133
|
+
>
|
|
1134
|
+
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 21 }}>
|
|
1135
|
+
<Icon name="sliders-horizontal" size={23} color="var(--md-primary)" />
|
|
1136
|
+
<span className="fin-adjust-btn-label">
|
|
1137
|
+
{isCash ? t('autobahn:finance.detailsShow') : t('autobahn:finance.adjustRate')}
|
|
1138
|
+
</span>
|
|
1139
|
+
</span>
|
|
1140
|
+
<Icon name="chevron-right" size={23} color="var(--md-primary)" />
|
|
1141
|
+
</button>
|
|
1142
|
+
)}
|
|
1143
|
+
</div>
|
|
1144
|
+
</div>
|
|
1145
|
+
);
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
export default FinanceCalculator;
|