// MRB Auto storefront — App shell wiring the sections together
const Icon = (props) => { const C = window.MRBAutoDesignSystem_73c751 && window.MRBAutoDesignSystem_73c751.Icon; return C ? React.createElement(C, props) : null; };
function FloatingWhatsApp() {
return (
);
}
function Toast({ msg }) {
if (!msg) return null;
return (
{msg}
);
}
function App() {
const [cart, setCart] = React.useState(2);
const [toast, setToast] = React.useState('');
const timer = React.useRef(null);
const notify = (m) => {
setToast(m);
clearTimeout(timer.current);
timer.current = setTimeout(() => setToast(''), 2400);
};
const addToCart = (p) => { setCart((c) => c + 1); notify(`Ajouté au panier — ${p.title.slice(0, 38)}…`); };
const onSelect = (sel) => notify(`${sel.marque} · ${sel.modele} · ${sel.gen} — pièces compatibles filtrées`);
return (
notify(`Marque sélectionnée : ${b}`)} />
);
}
// Wait until the design-system bundle has populated the namespace before mounting,
// so inlined/standalone builds don't render before components are registered.
(function mount() {
const ns = window.MRBAutoDesignSystem_73c751;
if (!ns || typeof ns.Icon !== 'function' || typeof ns.VehicleSelector !== 'function') {
return setTimeout(mount, 30);
}
const el = document.getElementById('page-root');
if (!el || el.__mounted) return;
el.__mounted = true;
ReactDOM.createRoot(el).render();
})();