import React from 'react'; import { Pressable, View, Text } from 'react-native'; import { useTheme } from '~/features/theme/ThemeProvider'; import Icon from '~/components/atoms/Icon'; import colors from '~/tailwind.config.js'; interface ClickableStatRowProps { title: string; value: string; icon: string; subtitle?: string; onPress?: () => void; isClickable?: boolean; } /** * Clickable version of StatRow for interactive elements like memo links */ const ClickableStatRow: React.FC = ({ title, value, icon, subtitle, onPress, isClickable = true, }) => { const { isDark, themeVariant } = useTheme(); const textColor = isDark ? '#FFFFFF' : '#000000'; const textSecondaryColor = isDark ? '#CCCCCC' : '#666666'; const primaryColor = isDark ? (colors as any).theme?.extend?.colors?.dark?.[themeVariant]?.primary : (colors as any).theme?.extend?.colors?.[themeVariant]?.primary; const borderColor = isDark ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'; const contentBackgroundColor = isDark ? (colors as any).theme?.extend?.colors?.dark?.[themeVariant]?.contentBackgroundHover : (colors as any).theme?.extend?.colors?.[themeVariant]?.contentBackgroundHover; const content = (isPressed?: boolean) => ( {title} {subtitle && ( {subtitle} )} {value} {isClickable && onPress && ( )} ); if (isClickable && onPress) { return ( ({ opacity: pressed ? 0.7 : 1, })} > {({ pressed }) => content(pressed)} ); } return content(false); }; export default ClickableStatRow;