/* eslint-disable react/no-unknown-property */ 'use client'; import React, { useRef } from 'react'; import { Canvas, useFrame } from '@react-three/fiber'; import { Sphere, MeshDistortMaterial, Environment, Float } from '@react-three/drei'; import * as THREE from 'three'; interface AIOrbProps { isThinking: boolean; } function Orb({ isThinking }: AIOrbProps) { const meshRef = useRef(null); const materialRef = useRef(null); // Dynamic properties based on state const targetDistort = isThinking ? 0.6 : 0.3; const targetSpeed = isThinking ? 5 : 2; const color = isThinking ? '#00FF88' : '#00A3FF'; // Green/Blue based on thinking state useFrame((state) => { if (!materialRef.current) return; // Smoothly interpolate material properties materialRef.current.distort = THREE.MathUtils.lerp( materialRef.current.distort, targetDistort, 0.1, ); materialRef.current.speed = THREE.MathUtils.lerp(materialRef.current.speed, targetSpeed, 0.1); // Smooth color transition const currentColor = materialRef.current.color; const targetColorObj = new THREE.Color(color); currentColor.lerp(targetColorObj, 0.05); // Slow rotation if (meshRef.current) { meshRef.current.rotation.x = state.clock.getElapsedTime() * 0.2; meshRef.current.rotation.y = state.clock.getElapsedTime() * 0.3; } }); return ( ); } export default function AIOrb({ isThinking = false }: AIOrbProps) { return (
{/* Ambient glow effect behind the orb */}
); }