import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; import { BorderlessButton } from 'react-native-gesture-handler'; import { themes } from '../../../lib/constants'; import { CustomIcon } from '../../../lib/Icons'; import sharedStyles from '../../Styles'; import Touch from '../../../utils/touch'; import { TServerHistoryModel } from '../../../definitions/IServerHistory'; import { TSupportedThemes } from '../../../theme'; const styles = StyleSheet.create({ container: { height: 56, paddingHorizontal: 15, flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, content: { flex: 1, flexDirection: 'column' }, server: { ...sharedStyles.textMedium, fontSize: 16 } }); interface IItem { item: TServerHistoryModel; theme: TSupportedThemes; onPress(url: string): void; onDelete(item: TServerHistoryModel): void; } const Item = ({ item, theme, onPress, onDelete }: IItem): JSX.Element => ( onPress(item.url)} theme={theme} testID={`server-history-${item.url}`}> {item.url} {item.username} onDelete(item)} testID={`server-history-delete-${item.url}`}> ); export default Item;