pl-fe: convert autosuggest input to functional component

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-11-09 12:31:35 +01:00
parent e50446dfb2
commit df3b5dfc35
2 changed files with 112 additions and 129 deletions

View File

@@ -15,13 +15,13 @@ interface ISpoilerInput extends Pick<IAutosuggestInput, 'onSuggestionsFetchReque
}
/** Text input for content warning in composer. */
const SpoilerInput = React.forwardRef<AutosuggestInput, ISpoilerInput>(({
const SpoilerInput: React.FC<ISpoilerInput> = ({
composeId,
onSuggestionsFetchRequested,
onSuggestionsClearRequested,
onSuggestionSelected,
theme,
}, ref) => {
}) => {
const intl = useIntl();
const dispatch = useAppDispatch();
const { language, modified_language, spoiler_text: spoilerText, spoilerTextMap, suggestions } = useCompose(composeId);
@@ -45,9 +45,8 @@ const SpoilerInput = React.forwardRef<AutosuggestInput, ISpoilerInput>(({
searchTokens={[':']}
id='cw-spoiler-input'
className='rounded-md !bg-transparent dark:!bg-transparent'
ref={ref}
/>
);
});
};
export { SpoilerInput as default };