"use client"; import dynamic from "next/dynamic"; import Image from "next/image"; import { useEffect, useState } from "react"; import mini from "@/assets/mini.png"; import { useT } from "@/components/locale-provider"; // three.js + drei only load once someone asks for the 3D car. const MiniModel = dynamic( () => import("@/components/mini").then((m) => m.MiniModel), { ssr: false, loading: () => (
), }, ); export function MiniCard() { const { mini: t } = useT(); const [show3D, setShow3D] = useState(false); useEffect(() => { const start = () => setShow3D(true); window.addEventListener("eric:mini", start); return () => window.removeEventListener("eric:mini", start); }, []); return (

{t.title}

{show3D ? (
) : ( )}
); }