Rocket.Chat.ReactNative/app/containers/MessageComposer/components/Autocomplete/AutocompleteSlashCommand.tsx

25 lines
742 B
TypeScript
Raw Normal View History

2024-01-25 14:11:07 +00:00
import React from 'react';
import { View, Text } from 'react-native';
import { IAutocompleteSlashCommand } from '../../interfaces';
import I18n from '../../../../i18n';
import { useStyle } from './styles';
export const AutocompleteSlashCommand = ({ item }: { item: IAutocompleteSlashCommand }) => {
const [styles] = useStyle();
return (
<View style={styles.slashItem}>
<View style={styles.slashTitle}>
<Text style={styles.slashTitleText} numberOfLines={1}>
/{item.title}
</Text>
</View>
{item.subtitle ? (
<View style={styles.slashSubtitle}>
<Text style={styles.slashSubtitleText}>{I18n.isTranslated(item.subtitle) ? I18n.t(item.subtitle) : item.subtitle}</Text>
</View>
) : null}
</View>
);
};