import React from 'react'; import { useFrame } from '@react-three/fiber'; import * as THREE from 'three'; const Planet = ({ name, size, distance, speed, color, texture, onClick, hasRings = false }) => { const planetRef = React.useRef(); const pivotRef = React.useRef(); useFrame((state) => { if (pivotRef.current) { pivotRef.current.rotation.y += speed * 0.005; } if (planetRef.current) { planetRef.current.rotation.y += 0.01; } }); return ( {/* Orbit path */} {/* Planet */} document.body.style.cursor = 'pointer'} onPointerOut={() => document.body.style.cursor = 'auto'} > {/* Rings for Saturn */} {hasRings && ( )} ); }; export default Planet;