import React from "react"; import { IconButton, Image, Text, VStack, FactoryComponentProps, ITextProps, IImageProps, } from "native-base"; import { EnhancedTouchableOpacity } from "../../EnhancedTouchableOpacity"; import { ForwardMedium } from "../../../../icons/navigation"; import type { IColors } from "native-base/lib/typescript/theme/base/colors"; import type { IFlipColors } from "../../../../config/interfaces/IFlipColors"; import type { ImageSourcePropType, TouchableOpacityProps } from "react-native"; export interface DirectionCardProps extends TouchableOpacityProps, Omit { title: React.ReactNode | string; titleProps?: ITextProps; description?: React.ReactNode | string; descriptionProps?: ITextProps; illustration?: ImageSourcePropType; illustrationProps?: IImageProps; customButton?: React.ReactElement; onPressIcon?: () => void; rightIcon?: JSX.Element; rightIconColor?: IFlipColors | IColors; as?: React.ComponentType; } const StyledEnhancedTouchableOpacity = EnhancedTouchableOpacity; export const DirectionCard: React.FC = (props) => { const { as, illustration, title, description, customButton, onPressIcon, rightIcon, rightIconColor, titleProps, descriptionProps, illustrationProps, ...rest } = props; const isDescAvailable = !!description; return ( {illustration ? ( ) : ( <> )} {title && ( {title} )} {description && !React.isValidElement(description) && ( {description} )} {description && React.isValidElement(description) && description} {!!customButton ? ( customButton ) : ( ) } /> )} ); }; export default DirectionCard;