'use client'; import { Button, ButtonGroup, Card, CardBody, Slider } from '@heroui/react'; import { useControlContext } from '@/contexts/control-context'; import { Actions } from './consts'; export const UIControls = () => { const { rubiksCubeRef, setBackground, cubeRoughness, setCubeRoughness, cubeSpeed, setCubeSpeed } = useControlContext(); const scramble = () => { const scrambleSteps = Array.from({ length: 20 }, () => Actions[Math.floor(Math.random() * Actions.length)]); rubiksCubeRef?.current?.rotate(scrambleSteps); }; const reset = () => { alert('Working on it!'); }; const solve = () => { alert('Working on it!'); }; const train = () => { alert('Working on it!'); }; return (
Controls
Background
setCubeRoughness(value as number)} minValue={0.2} maxValue={1} step={0.01} /> setCubeSpeed(value as number)} minValue={1} maxValue={10} step={1} />
Train my own model!
); };