signal-desktop/ts/components/GroupTitleInput.tsx

31 lines
744 B
TypeScript
Raw Normal View History

// 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-07-19 19:26:06 +00:00
import { Input } from './Input';
import type { LocalizerType } from '../types/Util';
type PropsType = {
disabled?: boolean;
i18n: LocalizerType;
onChangeValue: (value: string) => void;
value: string;
};
export const GroupTitleInput = forwardRef<HTMLInputElement, PropsType>(
({ i18n, disabled = false, onChangeValue, value }, ref) => {
return (
2021-07-19 19:26:06 +00:00
<Input
disabled={disabled}
i18n={i18n}
onChange={onChangeValue}
placeholder={i18n('setGroupMetadata__group-name-placeholder')}
maxLengthCount={32}
2021-07-19 19:26:06 +00:00
ref={ref}
value={value}
/>
);
}
);