import { useState } from 'react'; import { useSymbolScale } from '../../hooks/useSymbolScale'; import type { SymbolScaleConfig } from '../../contexts/symbolScaleState'; const LABELS: Record = { ship: '선박 심볼', aircraft: '항공기 심볼', }; export function SymbolScalePanel() { const { symbolScale, setSymbolScale } = useSymbolScale(); const [open, setOpen] = useState(false); const update = (key: keyof SymbolScaleConfig, val: number) => { setSymbolScale({ ...symbolScale, [key]: Math.round(val * 10) / 10 }); }; return (
{open && (
{(Object.keys(LABELS) as (keyof SymbolScaleConfig)[]).map(key => (
update(key, parseFloat(e.target.value))} /> {symbolScale[key].toFixed(1)}
))}
)}
); }