fix(Player): disable value labels of subtitles settings if value is null

This commit is contained in:
Tim 2026-01-22 10:47:45 +01:00
parent cce556e639
commit e6e05573cb

View file

@ -45,6 +45,10 @@ const Stepper = ({ className, label, value, unit, step, min, max, disabled, onCh
return disabled || typeof value !== 'number' || (typeof max === 'number' && value >= max); return disabled || typeof value !== 'number' || (typeof max === 'number' && value >= max);
}, [disabled, max, value]); }, [disabled, max, value]);
const valueLabel = useMemo(() => {
return (disabled || typeof value !== 'number') ? '--' : `${value}${unit}`;
}, [disabled, value, unit]);
const updateValue = useCallback((delta: number) => { const updateValue = useCallback((delta: number) => {
onChange(clamp(localValue.current + delta, min, max)); onChange(clamp(localValue.current + delta, min, max));
}, [onChange]); }, [onChange]);
@ -88,7 +92,7 @@ const Stepper = ({ className, label, value, unit, step, min, max, disabled, onCh
<Icon className={styles['icon']} name={'remove'} /> <Icon className={styles['icon']} name={'remove'} />
</Button> </Button>
<div className={styles['value']}> <div className={styles['value']}>
{ disabled ? '--' : `${value}${unit}` } { valueLabel }
</div> </div>
<Button <Button
className={classNames(styles['button'], { 'disabled': increaseDisabled })} className={classNames(styles['button'], { 'disabled': increaseDisabled })}