"use client"; import { Suspense } from "react"; import Image from "next/image"; import { Canvas } from "@react-three/fiber"; import { OrbitControls, useGLTF, Center, Environment } from "@react-three/drei"; import { motion } from "framer-motion"; interface ProductViewerProps { modelUrl?: string; images?: string[]; autoRotate?: boolean; } // 3D Model Component function Model({ modelUrl }: { modelUrl: string }) { const { scene } = useGLTF(modelUrl); return (
); } function ModelCanvas({ modelUrl }: { modelUrl: string }) { return ( ); } export function ProductViewer({ modelUrl, images = [], autoRotate = true, }: ProductViewerProps) { const [primaryImage] = images; return (
{modelUrl ? (
) : primaryImage ? ( Product ) : (
No preview available
)}
); }