import React from 'react'; import { StyleProp, StyleSheet, Text, TouchableOpacity, ViewStyle, } from 'react-native'; interface ServerCardProps { style?: StyleProp; name: string; url?: string; onPress?: () => void; } export const ServerCard: React.FC = React.memo((props) => { return ( {props.name} {props.url && {props.url}} ); }); ServerCard.displayName = 'ServerCard'; const styles = StyleSheet.create({ root: { height: 56, padding: 8, backgroundColor: 'white', borderRadius: 4, borderColor: '#ccc', borderWidth: 1, justifyContent: 'center', }, name: { fontSize: 16, textAlign: 'center', }, url: { color: '#999', textAlign: 'center', }, });