/** * ViewerControls — Controls for wireframe, lighting, screenshot, and auto-rotation. * Wraps into a scrollable row on mobile with larger tap targets. */ import { motion } from 'framer-motion'; import type { LightPreset } from '../types'; interface ViewerControlsProps { wireframe: boolean; setWireframe: (v: boolean) => void; lightPreset: LightPreset; setLightPreset: (v: LightPreset) => void; autoRotate: boolean; setAutoRotate: (v: boolean) => void; onScreenshot: () => void; } const LIGHT_PRESETS: { value: LightPreset; label: string; icon: string }[] = [ { value: 'studio', label: 'Studio', icon: '💡' }, { value: 'outdoor', label: 'Outdoor', icon: '☀️' }, { value: 'dramatic', label: 'Dramatic', icon: '🎭' }, ]; /** Small toggle / action pill */ function Pill({ active, onClick, children, activeClass = 'bg-indigo-500 text-white', }: { active: boolean; onClick: () => void; children: React.ReactNode; activeClass?: string; }) { return ( ); } export default function ViewerControls({ wireframe, setWireframe, lightPreset, setLightPreset, autoRotate, setAutoRotate, onScreenshot, }: ViewerControlsProps) { return ( {/* Horizontally scrollable strip — no wrapping on mobile */}
{/* Toggle controls */} setWireframe(!wireframe)}> ⬡ Wireframe setAutoRotate(!autoRotate)} activeClass="bg-cyan-500 text-white" > {autoRotate ? '⏹ Stop' : '🔄 Rotate'} {/* Screenshot — never "active" */} {/* Divider */} ); }