import React, { useState } from 'react'; import { Canvas } from '@react-three/fiber'; import { OrbitControls, PerspectiveCamera } from '@react-three/drei'; import './App.css'; const variants = { black: { geometry: , material: { color: "black", roughness: 1, metalness: 0 } }, silver: { geometry: , material: { color: "#C0C0C0", roughness: 0.3, metalness: 1 } }, gold: { geometry: , material: { color: "#FFD700", roughness: 0.4, metalness: 1 } } }; function Product({ variant }) { const { geometry, material } = variants[variant]; return ( {geometry} ); } export default function App() { const [activeVariant, setActiveVariant] = useState('black'); return (
{Object.keys(variants).map((variant) => ( ))}
); }