import React from 'react'; import { View, Pressable, ViewStyle } from 'react-native'; import { Text } from './Text'; import { Icon } from './Icon'; import { useThemeColors } from '~/utils/themeUtils'; interface SettingsItemProps { title: string; description?: string; icon?: string; onPress?: () => void; rightElement?: React.ReactNode; isLast?: boolean; } export const SettingsItem: React.FC = ({ title, description, icon, onPress, rightElement, isLast = false, }) => { const colors = useThemeColors(); const containerStyle: ViewStyle = { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 16, paddingVertical: 12, borderBottomWidth: isLast ? 0 : 1, borderBottomColor: colors.border, }; const renderContent = () => ( {icon && ( )} {title} {description && ( {description} )} {rightElement || ( )} ); if (onPress) { return ( ({ ...containerStyle, opacity: pressed ? 0.7 : 1, })}> {renderContent()} ); } return {renderContent()}; };