import { useAppDispatch } from 'app/store/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { controlNetWeightChanged } from 'features/controlNet/store/controlNetSlice'; import { memo, useCallback } from 'react'; type ParamControlNetWeightProps = { controlNetId: string; weight: number; }; const ParamControlNetWeight = (props: ParamControlNetWeightProps) => { const { controlNetId, weight } = props; const dispatch = useAppDispatch(); const handleWeightChanged = useCallback( (weight: number) => { dispatch(controlNetWeightChanged({ controlNetId, weight })); }, [controlNetId, dispatch] ); const handleWeightReset = () => { dispatch(controlNetWeightChanged({ controlNetId, weight: 1 })); }; return ( ); }; export default memo(ParamControlNetWeight);