The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rocket.Chat/client/components/admin/settings/inputs/IntSettingInput.js

44 lines
881 B

import {
Field,
Label,
InputBox,
} from '@rocket.chat/fuselage';
import React from 'react';
import { ResetSettingButton } from '../ResetSettingButton';
export function IntSettingInput({
_id,
label,
value,
placeholder,
readonly,
autocomplete,
disabled,
onChangeValue,
hasResetButton,
onResetButtonClick,
}) {
const handleChange = (event) => {
onChangeValue(parseInt(event.currentTarget.value, 10));
};
return <>
<Field.Row>
<Label htmlFor={_id} text={label} title={_id} />
{hasResetButton && <ResetSettingButton data-qa-reset-setting-id={_id} onClick={onResetButtonClick} />}
</Field.Row>
<InputBox
data-qa-setting-id={_id}
id={_id}
type='number'
value={value}
placeholder={placeholder}
disabled={disabled}
readOnly={readonly}
autoComplete={autocomplete === false ? 'off' : undefined}
onChange={handleChange}
/>
</>;
}