import React from 'react'; import { TextStyle, PressableProps, DimensionValue } from 'react-native'; import ThemedButton from '@/components/theme/buttons/ThemedButton'; import ThemedText from '@/components/theme/default/ThemedText'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; // Extend ThemedButton props (which already extends PressableProps) type ThemedTextButtonProps = Omit & { width?: DimensionValue; height?: DimensionValue; text: string; fontSize?: number; fontWeight?: 'normal' | 'semibold' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; textStyle?: TextStyle; containerStyle?: object; buttonStyle?: object; textColor?: string; backgroundColor?: string; }; const ThemedTextButton: React.FC = ({ width, height, text, fontSize = 16, fontWeight = 'normal', textStyle, containerStyle, buttonStyle, textColor = Colors[useColorScheme() ?? 'dark'].background, backgroundColor = Colors[useColorScheme() ?? 'dark'].text, ...restProps // This includes onPress and all other Pressable props }) => { if (fontWeight === 'semibold') fontWeight = '600'; return ( {text} ); }; export default ThemedTextButton;