import * as React from 'react'; import { TouchableOpacity, View } from 'react-native'; import Text from './text'; type TextButtonVariant = 'brand' | 'neutral' | 'neutralLow' | 'inverse'; type TextButtonSize = 'small' | 'medium' | 'large'; interface IconProps { icon: React.ReactNode; gap?: string | number; } interface TextButtonPreset { textColor: string; } const TEXT_BUTTON_PRESETS: Record = { brand: { textColor: 'emerald-500', // #10B981 }, neutral: { textColor: 'gray-900', }, neutralLow: { textColor: 'gray-500', }, inverse: { textColor: 'white', }, }; const SIZE_PRESETS: Record = { small: 'text-prime-text-13', medium: 'text-prime-text-15', large: 'text-prime-text-16', }; interface TextButtonProps { variant?: TextButtonVariant; size?: TextButtonSize; text: string; disabled?: boolean; bold?: boolean; underline?: boolean; leftIcon?: IconProps; rightIcon?: IconProps; className?: string; onPress?: () => void; } export default function TextButton({ variant = 'neutral', size = 'medium', text, disabled = false, bold = false, underline = false, leftIcon, rightIcon, className, onPress, }: TextButtonProps) { const preset = TEXT_BUTTON_PRESETS[variant]; const getMarginStyle = (gap?: string | number, isLeft: boolean = true) => { if (!gap) return {}; if (typeof gap === 'number') { return isLeft ? { marginRight: gap } : { marginLeft: gap }; } return { className: gap }; }; return ( {leftIcon && ( {leftIcon.icon} )} {text} {rightIcon && ( {rightIcon.icon} )} ); }