import { View, Text, Image, StyleSheet, Pressable, Dimensions } from 'react-native'; import React from 'react'; import { StarSvg } from './SVG'; import { router } from 'expo-router'; const { width, height } = Dimensions.get('window'); const imageHeight = height < 700 ? 100 : 130; const imageWidth = width < 400 ? 120 : 146; const carHeight = height < 700 ? 48 : 72; const carWidth = width < 400 ? 100 : 140; const truncateText = (text, maxLength) => { if (text.length <= maxLength) return text; return text.substr(0, maxLength) + '...'; }; const ChooseCarForChargingRow = ({ image, VehicleName, isDefault, onPress, isSelected }: { isSelected?: boolean; image?: any; VehicleName: string; isDefault: boolean; onPress: () => void; }) => ( {isDefault && ( <> )} {/* */} {truncateText(VehicleName, 10)} ); export default ChooseCarForChargingRow; const styles = StyleSheet.create({ container: { overflow: 'hidden', borderRadius: 8, alignItems: 'center', justifyContent: 'center', marginRight: 12, position: 'relative' }, grayColor: { color: '#888888' }, topLeftTriangle: { width: 0, height: 0, borderLeftWidth: 50, borderBottomWidth: 50, borderLeftColor: '#02677D', borderBottomColor: 'transparent', position: 'absolute', top: 0, left: 0 }, text: { fontWeight: 300, color: '#000000' } });