"use client"; import { SwitchMiiInstructions } from "@/types"; import EnhancedSlider from "@/components/submit-form/mii-editor/enhanced-slider"; interface Props { data: SwitchMiiInstructions["voice"]; onChange?: (value: number, label: string) => void; onClickTone?: (i: number) => void; } const VOICE_SETTINGS = ["Speed", "Pitch", "Depth", "Delivery"]; export default function VoiceViewer({ data, onChange, onClickTone }: Props) { return (
{VOICE_SETTINGS.map((label) => { const value = data[label.toLowerCase() as keyof typeof data] ?? 25; return onChange ? ( onChange?.(v, label.toLowerCase())} min={0} max={50} mid={25} /> ) : (
{label} {value === 25 ? "0" : value > 25 ? `+${value - 25}` : `${value - 25}`}
); })}
{Array.from({ length: 6 }).map((_, i) => ( ))}
); }