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/StringSettingInput.js

55 lines
1.2 KiB

import { Box, Field, Flex, TextAreaInput, TextInput } from '@rocket.chat/fuselage';
import React from 'react';
import { ResetSettingButton } from '../ResetSettingButton';
export function StringSettingInput({
_id,
label,
disabled,
multiline,
placeholder,
readonly,
autocomplete,
value,
hasResetButton,
onChangeValue,
onResetButtonClick,
}) {
const handleChange = (event) => {
onChangeValue(event.currentTarget.value);
};
return <>
<Flex.Container>
<Box>
<Field.Label htmlFor={_id} title={_id}>{label}</Field.Label>
{hasResetButton && <ResetSettingButton data-qa-reset-setting-id={_id} onClick={onResetButtonClick} />}
</Box>
</Flex.Container>
<Field.Row>
{multiline
? <TextAreaInput
data-qa-setting-id={_id}
id={_id}
rows={4}
value={value}
placeholder={placeholder}
disabled={disabled}
readOnly={readonly}
autoComplete={autocomplete === false ? 'off' : undefined}
onChange={handleChange}
/>
: <TextInput
data-qa-setting-id={_id}
id={_id}
value={value}
placeholder={placeholder}
disabled={disabled}
readOnly={readonly}
autoComplete={autocomplete === false ? 'off' : undefined}
onChange={handleChange}
/> }
</Field.Row>
</>;
}