2021-03-08 22:31:19 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-07-19 19:26:06 +00:00
|
|
|
import React, { forwardRef } from 'react';
|
2021-03-08 22:31:19 +00:00
|
|
|
|
2021-07-19 19:26:06 +00:00
|
|
|
import { Input } from './Input';
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { LocalizerType } from '../types/Util';
|
2021-03-08 22:31:19 +00:00
|
|
|
|
|
|
|
type PropsType = {
|
|
|
|
disabled?: boolean;
|
|
|
|
i18n: LocalizerType;
|
|
|
|
onChangeValue: (value: string) => void;
|
|
|
|
value: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const GroupTitleInput = forwardRef<HTMLInputElement, PropsType>(
|
2022-11-18 00:45:19 +00:00
|
|
|
function GroupTitleInputInner(
|
|
|
|
{ i18n, disabled = false, onChangeValue, value },
|
|
|
|
ref
|
|
|
|
) {
|
2021-03-08 22:31:19 +00:00
|
|
|
return (
|
2021-07-19 19:26:06 +00:00
|
|
|
<Input
|
|
|
|
disabled={disabled}
|
|
|
|
i18n={i18n}
|
|
|
|
onChange={onChangeValue}
|
|
|
|
placeholder={i18n('setGroupMetadata__group-name-placeholder')}
|
2021-07-21 20:45:41 +00:00
|
|
|
maxLengthCount={32}
|
2021-07-19 19:26:06 +00:00
|
|
|
ref={ref}
|
|
|
|
value={value}
|
|
|
|
/>
|
2021-03-08 22:31:19 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|