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