import React, { useState } from 'react'; import { NumberInput, StageConfigField } from '@spinnaker/core'; import type { IScaleCommand } from './scale.controller'; export interface IScaleSettingsFormProps { options: IScaleCommand; onChange(options: IScaleCommand): void; } export interface IScaleSettingsFormState { options: IScaleCommand; } export function ScaleSettingsForm({ options, onChange }: IScaleSettingsFormProps) { const [state, setState] = useState({ options: options, }); const updateReplicas = (newReplicas: number) => { state.options.replicas = newReplicas; if (onChange) { onChange(state.options); } setState({ options: state.options }); }; return (
) => { updateReplicas(e.target.valueAsNumber); }} value={options.replicas} min={0} />
); }