signal-desktop/ts/components/GroupDescriptionInput.tsx

39 lines
907 B
TypeScript
Raw Normal View History

2021-06-02 00:24:28 +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-06-02 00:24:28 +00:00
2021-07-19 19:26:06 +00:00
import { Input } from './Input';
import type { LocalizerType } from '../types/Util';
2021-06-02 00:24:28 +00:00
type PropsType = {
disabled?: boolean;
i18n: LocalizerType;
onChangeValue: (value: string) => void;
value: string;
};
2021-07-19 19:26:06 +00:00
export const GroupDescriptionInput = forwardRef<HTMLInputElement, PropsType>(
2022-11-18 00:45:19 +00:00
function GroupDescriptionInput(
{ i18n, disabled = false, onChangeValue, value },
ref
) {
2021-06-02 00:24:28 +00:00
return (
2021-07-19 19:26:06 +00:00
<Input
disabled={disabled}
expandable
i18n={i18n}
onChange={onChangeValue}
2023-03-30 00:03:25 +00:00
placeholder={i18n(
'icu:setGroupMetadata__group-description-placeholder'
)}
maxLengthCount={480}
maxByteCount={8192}
2021-07-19 19:26:06 +00:00
ref={ref}
value={value}
whenToShowRemainingCount={380}
2021-07-19 19:26:06 +00:00
/>
2021-06-02 00:24:28 +00:00
);
}
);