// ============================================================
// SpinBox — spinBox → InputNumber (step=1)
// 用于整数输入：混沌、风格化、怪异、时长、音调等
// ============================================================

import { InputNumber } from 'antd';
import type { WidgetProps } from './types';

export function SpinBox({ value, onChange, disabled, config }: WidgetProps) {
   return (
      <InputNumber
         value={value as number}
         onChange={(v) => onChange?.(v != null ? v : undefined)}
         disabled={disabled}
         min={config.minValue as number | undefined}
         max={config.maxValue as number | undefined}
         step={1}
         style={{ width: '100%' }}
         placeholder={(config.placeholder as string) || undefined}
      />
   );
}
