import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { Flag, GiphyIcon, Imgur, Lightning, Mute, Sound, UserAdd, UserDelete } from '../../icons'; import type { SuggestionCommand } from '../../contexts/suggestionsContext/SuggestionsContext'; import type { DefaultCommandType } from '../../types/types'; const styles = StyleSheet.create({ args: { fontSize: 14, }, container: { alignItems: 'center', flexDirection: 'row', paddingHorizontal: 16, paddingVertical: 8, }, iconContainer: { alignItems: 'center', borderRadius: 12, height: 24, justifyContent: 'center', marginRight: 8, width: 24, }, title: { fontSize: 14, fontWeight: 'bold', paddingRight: 8, }, }); const Icon = ({ name, }: { name: SuggestionCommand['name']; }) => { const { theme: { colors: { accent_blue, white }, messageInput: { suggestions: { command: { iconContainer }, }, }, }, } = useTheme(); switch (name) { case 'ban': return ( ); case 'flag': return ( ); case 'giphy': return ( ); case 'imgur': return ( ); case 'mute': return ( ); case 'unban': return ( ); case 'unmute': return ( ); default: return ( ); } }; export type CommandsItemProps = { /** * A CommandResponse of suggested CommandTypes with these properties * * - args: Arguments which can be passed to the command * - name: Name of the command */ item: SuggestionCommand; }; export const CommandsItem = ({ item: { args, name }, }: CommandsItemProps) => { const { theme: { colors: { black, grey }, messageInput: { suggestions: { command: { args: argsStyle, container, title }, }, }, }, } = useTheme(); return ( {(name || '').replace(/^\w/, (char) => char.toUpperCase())} {`/${name} ${args}`} ); }; CommandsItem.displayName = 'CommandsItem{messageInput{suggestions{command}}}';